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;
using lli = long long int;
using vb = vector<bool>;
using vc = vector<char>;
using vd = vector<double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vlli = vector<lli>;
using vvlli = vector<vlli>;
using pi = pair<int, int>;
using plli = pair<lli, lli>;
char readc() {
  char q;
  scanf("%c", &q);
  return q;
}
int readint() {
  int q;
  scanf("%d", &q);
  return q;
}
lli readlong() {
  lli q;
  scanf("%lld", &q);
  return q;
}
double readdbl() {
  double q;
  scanf("%lf", &q);
  return q;
}
void printint(int q) { printf("%d", q); }
void printlong(lli q) { printf("%lld", q); }
void printdbl(double q, int p = 6) { printf("%.*lf", p, q); }
void readln() { scanf("\n"); }
void println() { printf("\n"); }
void printsp() { printf(" "); }
void print(int q) { printint(q); }
void print(long q) { printlong((lli)q); }
void print(lli q) { printlong(q); }
void print(double q) { printdbl(q); }
void print(char c) { printf("%c", c); }
void print(pi q) {
  print(q.first);
  printsp();
  print(q.second);
}
void print(vi q) {
  for (int i = 0; i < q.size(); ++i) {
    print(q[i]);
    printsp();
  }
}
void print(vlli q) {
  for (int i = 0; i < q.size(); ++i) {
    print(q[i]);
    printsp();
  }
}
void print(vd q) {
  for (int i = 0; i < q.size(); ++i) {
    print(q[i]);
    printsp();
  }
}
template <typename T>
void println(T q) {
  print(q);
  println();
}
template <typename T>
T maxim(T f, T s) {
  return (f > s) ? f : s;
}
template <typename T>
T minim(T f, T s) {
  return (f < s) ? f : s;
}
template <typename T>
T abs(T arg) {
  return arg < 0 ? -arg : arg;
}
const lli modulo = 998244353;
vector<string> elems = {
    "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"};
bool dp[20];
int main() {
  string s;
  cin >> s;
  dp[0] = true;
  for (int i = 1; i <= s.size(); ++i) {
    for (auto e : elems) {
      if (e.size() == 1 && e[0] == s[i - 1]) {
        dp[i] |= dp[i - 1];
      }
      if (e.size() == 2 && i > 1 && e[0] == s[i - 2] &&
          e[1] - 'a' + 'A' == s[i - 1]) {
        dp[i] |= dp[i - 2];
      }
    }
  }
  if (dp[s.size()])
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}