/* regex mindcoding round3 */ #include<vector> #include<string> #include<string.h> #include<algorithm> #include<cstdio> #include<fstream> #include<iostream> #include<ctime> #include<set> #include<map> #include<cmath> using namespace std; #define LL long long; #define PII pair<int ,int> #define PCI pair<char ,int> #define VB vector <bool> #define VI vector <int> #define VC vector <char> #define WI vector<VI> #define WC vector<VC> #define RS resize #define X first #define Y second #define FORN(i,n) for(int i=0;i<n;++i) #define FOR(i,a,b) for(int i=a;i<=b;++i) #define FORD(i,a,b) for(int i=a;i>=b;--i) #define REPEAT do #define UNTIL(x) while((x)) #define IN_FILE "date.in" #define OUT_FILE "date.out" ifstream f(IN_FILE); ofstream g(OUT_FILE); //variables string text; bool ok = true; //other functions bool check(char a, int pos) { if (text[pos] == a) { return true; } return false; } void reading() { cin >> text; } void solving() { FORN(i, text.length()) { if (text[i] == 'Y') { int lit = 0; ok = true; int aux2 = i; char aux = 'Y'; FOR(j, i, i + 4) { if (lit == 0) { aux = 'Y'; } else if (lit == 1) { aux = 'a'; } else if (lit == 2) { aux = 'r'; } else if (lit == 3) { aux = 'd'; } else if (lit == 4) { aux = 'i'; } if (!check(aux,aux2)) { ok = false; break; } ++aux2; ++lit; } if (ok) { return; } } } } void write_data() { if (ok) { cout << "YES"; } else { cout << "NO"; } } int main() { reading(); solving(); write_data(); }