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;
const int N = 1010;
string s[500] = {
    "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",
};
struct AcTrie {
  int next[N][26], fail[N], len[N];
  int root, tot;
  int newnode() {
    for (int i = 0; i < 26; ++i) next[tot][i] = -1;
    len[tot++] = 0;
    return tot - 1;
  }
  void init() {
    tot = 0;
    root = newnode();
  }
  int flx(char c) { return c - 'A'; }
  void insert(string buf) {
    int l = buf.length(), now = root;
    for (int i = 0; i < l; ++i) {
      if (next[now][flx(buf[i])] == -1) next[now][flx(buf[i])] = newnode();
      now = next[now][flx(buf[i])];
    }
    len[now] = l;
  }
  void build() {
    queue<int> Q;
    fail[root] = root;
    for (int i = 0; i < 26; ++i) {
      if (next[root][i] == -1)
        next[root][i] = root;
      else {
        fail[next[root][i]] = root;
        Q.push(next[root][i]);
      }
    }
    while (!Q.empty()) {
      int now = Q.front();
      Q.pop();
      for (int i = 0; i < 26; ++i) {
        if (next[now][i] == -1)
          next[now][i] = next[fail[now]][i];
        else {
          fail[next[now][i]] = next[fail[now]][i];
          Q.push(next[now][i]);
        }
      }
    }
  }
} ac;
bool dp[N];
char str[N];
int n;
int main() {
  ac.init();
  for (int i = 0; i < 500; ++i) ac.insert(s[i]);
  ac.build();
  scanf("%s", str + 1);
  n = strlen(str + 1);
  dp[0] = true;
  for (int i = 1, now = 0; i <= n; ++i) {
    now = ac.next[now][str[i] - 'A'];
    for (int j = now; j; j = ac.fail[j]) dp[i] |= dp[i - ac.len[j]];
  }
  if (dp[n])
    printf("YES\n");
  else
    printf("NO\n");
}