#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long x = 0;
  bool f = 0;
  while (!isdigit(c)) f ^= !(c ^ 45), c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
bool orz[26] = {1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1,
                1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1};
char s[10000010];
bool f1, f2;
int main() {
  cin >> s;
  for (int i = 0; s[i]; ++i) {
    int c = s[i] - 'A';
    if (orz[c] && f2) return puts("NO"), 0;
    if (orz[c]) f1 = 1;
    if (!orz[c] && f1) return puts("NO"), 0;
    if (!orz[c]) f2 = 1;
  }
  puts("YES");
  return 0;
}
