#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define int long long #define endl '\n' #define INF 1000000000000000000 #define EPS 1e-10 #define PI 3.141592653589793238 #define all(a) a.begin(),a.end() #define rep(i, n) for (int i = 0; i < (n); i++) #define pb push_back #define double long double using namespace std; typedef long long ll; typedef pair P; typedef pair PP; typedef complex com; template bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; } ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); } ll lcm(ll n, ll m) { return n / gcd(n, m)*m; } signed main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); //modcalc(); vector cnt(26); vector cnt2(26); string s; int check = 0; char d; while (cin >> s) { for (char c : s) { if (check == 0) cnt[c - 'a']++; else cnt2[c - 'a']++; check ^= 1; d = c; } check ^= 1; } rep(i, 26) { if (cnt[i] > 1 && cnt2[i] == 0 || cnt[i] == 0 && cnt2[i] > 1) { cout << "Yes" << endl; return 0; } if (cnt[i] == 1 && cnt2[i] == 0 && check) { cout << "Yes" << endl; return 0; } if (cnt[i] == 1 && cnt2[i] == 0 && !check&& d - 'a' != i) { cout << "Yes" << endl; return 0; } if (cnt2[i] == 1 && cnt[i] == 0 && !check) { cout << "Yes" << endl; return 0; } if (cnt2[i] == 1 && cnt[i] == 0 && check&& d - 'a' != i) { cout << "Yes" << endl; return 0; } } cout << "NO" << endl; }