#include #include #include #include using namespace std; int main() { string S; getline(cin, S); int n = S.size(); for (int p : {0, 1}) { vector B(26, false); for (int i = 0; i < n; ++i) { if ((i + 1) % 2!= p && islower(S[i])) { B[S[i] - 'a'] = true; } } vector non_blanks; for (int i = 0; i < n; ++i) { if ((i + 1) % 2 == p && islower(S[i]) &&!B[S[i] - 'a']) { non_blanks.push_back(i + 1); } } if (non_blanks.empty()) continue; int first = non_blanks[0]; int last = non_blanks.back(); int expected = (last - first) / 2 + 1; if (non_blanks.size()!= expected) continue; if (last > first) { cout << "Yes\n"; return 0; } else { if (first + 1 <= n) { cout << "Yes\n"; return 0; } } } cout << "NO\n"; return 0; }