Problem: 

Input

The input consists of a single string of uppercase letters A-Z. The length of the string is between 1 and 10 characters, inclusive.

Output

Output "YES" or "NO".

Examples

Input


GENIUS


Output


YES


Input


DOCTOR


Output


NO


Input


IRENE


Output


YES


Input


MARY


Output


NO


Input


SMARTPHONE


Output


NO


Input


REVOLVER


Output


YES


Input


HOLMES


Output


NO


Input


WATSON


Output


YES

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
std::mt19937 rnd(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXLEN = 10;
const int NELEM = 118;
const char ELEMS[NELEM][3] = {
    "H",  "He", "Li", "Be", "B",  "C",  "N",  "O",  "F",  "Ne", "Na", "Mg",
    "Al", "Si", "P",  "S",  "Cl", "Ar", "K",  "Ca", "Sc", "Ti", "V",  "Cr",
    "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr",
    "Rb", "Sr", "Y",  "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd",
    "In", "Sn", "Sb", "Te", "I",  "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd",
    "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf",
    "Ta", "W",  "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po",
    "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U",  "Np", "Pu", "Am", "Cm",
    "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs",
    "Mt", "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og"};
const int ALPH = 26;
struct TrieNode {
  int nxt[ALPH];
  int safenxt[ALPH];
  int suff;
  int finalmask;
};
char s[MAXLEN + 1];
int slen;
vector<TrieNode> trie;
int trieroot;
int maketrienode() {
  TrieNode node;
  for (int i = (0); i < (ALPH); ++i) node.nxt[i] = -1;
  node.suff = -1;
  node.finalmask = 0;
  trie.push_back(node);
  return ((int)(trie).size()) - 1;
}
bool solve() {
  trie.clear();
  trieroot = maketrienode();
  for (int i = (0); i < (NELEM); ++i) {
    int at = trieroot;
    int len = strlen(ELEMS[i]);
    for (int j = (0); j < (len); ++j) {
      char c = toupper(ELEMS[i][j]);
      assert(isupper(c));
      int k = c - 'A';
      int to = trie[at].nxt[k];
      if (to == -1) {
        to = maketrienode();
        trie[at].nxt[k] = to;
      }
      at = to;
    }
    trie[at].finalmask = 1 << len;
  }
  queue<int> q;
  q.push(trieroot);
  while (!q.empty()) {
    int at = q.front();
    q.pop();
    for (int k = (0); k < (ALPH); ++k) {
      int suff;
      if (at == trieroot) {
        suff = at;
      } else {
        suff = trie[at].suff;
        while (suff != trieroot && trie[suff].nxt[k] == -1)
          suff = trie[suff].suff;
        if (trie[suff].nxt[k] != -1) suff = trie[suff].nxt[k];
      }
      int to = trie[at].nxt[k];
      trie[at].safenxt[k] = to == -1 ? suff : to;
      if (to != -1) {
        trie[to].suff = suff;
        trie[to].finalmask = trie[to].finalmask | trie[suff].finalmask;
        q.push(to);
      }
    }
  }
  {
    vector<bool> dp(slen, false);
    dp[0] = true;
    int at = trieroot;
    for (int i = (0); i < (slen); ++i) {
      char c = s[i];
      assert(isupper(c));
      int k = c - 'A';
      at = trie[at].safenxt[k];
      for (int len = 1; (1 << len) <= trie[at].finalmask; ++len)
        if (trie[at].finalmask & (1 << len))
          if (dp[i + 1 - len]) dp[i + 1] = true;
    }
    return dp[slen];
  }
}
void run() {
  scanf("%s", s);
  slen = strlen(s);
  printf("%s\n", solve() ? "YES" : "NO");
}
int main() {
  run();
  return 0;
}