#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[11];
  cin >> a;
  long long int i;
  if (strlen(a) <= 2) {
    cout << "YES";
    return 0;
  }
  long long int b, c, f;
  f = 0;
  b = a[0] - 65;
  c = a[1] - 65;
  for (i = 2; i < strlen(a); i++) {
    if ((b + c) % 26 == (a[i] - 65)) {
      f = 0;
      b = c;
      c = a[i] - 65;
    } else {
      f = 1;
      break;
    }
  }
  if (f == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
