#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 2; i < (int)s.size(); i++) {
    int x = (int)(s[i - 2] - 'A');
    int y = (int)(s[i - 1] - 'A');
    int z = (int)(s[i - 0] - 'A');
    if ((x + y) % 26 != z) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
