#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex Complex; const int INF = 1e9; const ll LINF = 1e18; const ll MOD = 998244353; template bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template vector make_vec(size_t a) { return vector(a); } template auto make_vec(size_t a, Ts... ts) { return vector(ts...))>(a, make_vec(ts...)); } int main() { string s; getline(cin, s); for (char& c : s) if (c == ' ') c = '.'; vector v(26); int n = sz(s); for (int i = 1; i < n; i += 2) { if (s[i] != '.') { v[s[i] - 'a'] = 1; s[i] = '.'; } } for (char& c : s) if (c != '.' && v[c - 'a']) c = '.'; int l = 0, r = n - 1; while (l < n && s[l] == '.') l++; while (r - 1 >= 0 && s[r - 1] == '.') r--; // cout << s << " " << l << " " << r << endl; if (r <= l) { cout << "NO" << endl; return 0; } for (int i = l; i < r; i += 2) { if (s[i] == '.') { cout << "NO" << endl; return 0; } } cout << "Yes" << endl; }