#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const long long INF = 2e9, MOD = 1e9 + 7;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  if ((long long)s.size() <= 2) {
    cout << "YES"
         << "\n";
    return 0;
  }
  long long x = 'Z' - 'A';
  x++;
  long long cur = ((long long)(s[0] - 'A') + (long long)(s[1] - 'A')) % x;
  for (long long i = 2; i < (long long)s.size(); i++) {
    if ((s[i] - 'A') != cur) {
      cout << "NO"
           << "\n";
      return 0;
    }
    cur = ((long long)(s[i] - 'A') + (long long)(s[i - 1] - 'A')) % x;
  }
  cout << "YES"
       << "\n";
  return 0;
}
