#include #include using namespace std; #define YES cout << "Yes" << endl #define NO cout << "No" << endl int main(void){ int n; string s; cin >> n >> s; int mcnt = 0; string sub1, sub2; for (int i = 0; i < (int)s.size(); i++) { sub1 = s.substr(i, 1); sub2 = s.substr(i, 2); if (sub2 == "w?") { mcnt += 2; i++; } else if (sub2 == "?a" || sub2 == "?o") { mcnt += 2; i++; } else if (sub2 == "wa" || sub2 == "wo") { mcnt += 2; i++; } else if (sub1 == "?" || sub1 == "n") { mcnt++; i++; } } mcnt == (int)s.size() ? YES : NO; }