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