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;
char el[118][3] = {
    "H",  "HE", "LI", "BE", "B",  "C",  "N",  "O",  "F",  "NE", "NA", "MG",
    "AI", "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"};
struct AC_Automata {
  static const int MAXN = 1005;
  static const int DICTN = 26;
  int nxt[MAXN][DICTN], bo[MAXN], fail[MAXN], el_len[MAXN], que[MAXN], tot,
      str_len;
  bool is_el[MAXN][MAXN], dp[MAXN];
  void init() {
    tot = 1;
    for (int i = 0; i < DICTN; ++i) nxt[0][i] = 1;
  }
  void clear_trie() {
    for (int i = 1; i <= tot; ++i) {
      bo[i] = 0;
      for (int j = 0; j < DICTN; ++j) {
        nxt[i][j] = 0;
      }
    }
    tot = 1;
  }
  void insert_str(char *s) {
    int u = 1;
    for (int i = 0; s[i]; ++i) {
      int c = s[i] - 'A';
      if (!nxt[u][c]) nxt[u][c] = ++tot;
      u = nxt[u][c];
    }
    bo[u] = 1;
    el_len[u] = strlen(s);
  }
  void get_fail() {
    que[1] = 1;
    fail[1] = 0;
    for (int q1 = 1, q2 = 1; q1 <= q2; ++q1) {
      int u = que[q1];
      if (bo[fail[u]]) bo[u] = bo[fail[u]];
      for (int i = 0; i < DICTN; ++i) {
        if (!nxt[u][i])
          nxt[u][i] = nxt[fail[u]][i];
        else {
          que[++q2] = nxt[u][i];
          fail[nxt[u][i]] = nxt[fail[u]][i];
        }
      }
    }
  }
  void solve(char *s) {
    str_len = strlen(s);
    int u = 1;
    for (int i = 0; i < str_len; ++i) {
      int c = s[i] - 'A';
      int k = nxt[u][c];
      while (k > 1) {
        if (bo[k]) is_el[i - el_len[k] + 1][i] = true;
        k = fail[k];
      }
      u = nxt[u][c];
    }
    for (int i = 0; i < str_len; i++) {
      dp[i] = is_el[0][i];
      for (int j = 0; j < i; j++) {
        dp[i] |= dp[j] && is_el[j + 1][i];
      }
    }
  }
} ac;
int main() {
  ac.init();
  for (int i = 0; i < 118; i++) ac.insert_str(el[i]);
  ac.get_fail();
  char str[1005];
  scanf("%s", str);
  ac.solve(str);
  puts(ac.dp[ac.str_len - 1] ? "YES" : "NO");
  return 0;
}