#include <iostream> #include <string> using namespace std; string s; bool func(int m, int n) { if(m == n) { if(s[m] >= 'p' && s[m] <= 'z') return true; else return false; } if(s[m] == 'N') { if(func(m+1, n)) return true; else return false; } else if(s[m] == 'C' || s[m] == 'D' || s[m] == 'E' || s[m] == 'I') { for(int i = 1; i <= n-m; ++i) { if(func(m+1, m+i)&&func(m+i+1, n)) return true; } return false; } else return false; } int main() { while(cin >> s) { bool flag = false; if(s.length() == 1 && s[0] >= 'p' && s[0] <= 'z') flag = true; else if(func(0, s.length()-1)) flag = true; if(flag) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }