#include <bits/stdc++.h>
long long mod = 1e9 + 7;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
using namespace std;
int c = 0;
long long pow(long long a, long long b) {
  long long ans = 1;
  if (b == 0) return 1;
  ans *= pow(a, b / 2);
  ans = ((ans % mod) * (ans % mod)) % mod;
  if (b & 1) {
    ans = ((ans % mod) * a);
    ans %= mod;
  }
  return ans % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long> fac(1e6 + 5, -1);
long long fact(long long n) {
  if (n <= 1) return fac[n] = 1ll;
  if (fac[n] > 0) return fac[n];
  fac[n] = n * fact(n - 1);
  fac[n] %= mod;
  return fac[n];
}
long long nCr(long long n, long long r) {
  if (n == r || r == 0) return 1;
  long long ans = fac[n];
  ans *= pow(fac[n - r], mod - 2);
  ans %= mod;
  ans *= pow(fac[r], mod - 2);
  ans %= mod;
  return ans;
}
const long long nax = 1e5 + 3;
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 2; i < n; i++) {
    if (s[i] != 'A' + ((s[i - 2] - 'A') + (s[i - 1] - 'A')) % 26) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int q = 1;
  while (q--) {
    c++;
    solve();
  }
}
