#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int32_t main() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (char c : s) {
    mp[c] = (int)(c - 'A');
  }
  bool ok = true;
  for (int i = 2; i < s.length(); i++) {
    if (mp[s[i]] != (mp[s[i - 1]] + mp[s[i - 2]]) % 26) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
