#include <bits/stdc++.h>
using namespace std;
const long long M = 1010;
const long long N = 1010;
const long long mod = 1e9 + 7;
long long INF = (long long)1e8;
long long dp[N][N][2];
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
void solve() {
  string s;
  cin >> s;
  if (s.size() == 1 || s.size() == 2) {
    cout << "YES" << endl;
    return;
  }
  long long a = s[0] - 'A';
  long long b = s[1] - 'A';
  long long n = s.size();
  for (long long i = 2; i < n; i++) {
    char c = s[i] - 'A';
    if (c == (a + b) % 26) {
      a = b;
      b = c;
    } else {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
signed main() {
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
