#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
void prec() {}
void solve(istream &cin, ostream &cout) {
  string s;
  cin >> s;
  bool ok = true;
  for (size_t i = 2; i < s.size(); i++) {
    int a = s[i - 2] - 'A';
    int b = s[i - 1] - 'A';
    int c = s[i] - 'A';
    if ((a + b) % 26 != c) ok = false;
  }
  cout << (ok ? "YES" : "NO") << '\n';
}
struct CFibonacciWords {
  void solve(std::istream &in, std::ostream &out) { ::solve(in, out); }
};
int main() {
  prec();
  CFibonacciWords solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
