#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace::std; template ostream& operator<< (ostream& o, const pair& p) { o << "<" << p.first << ", " << p.second << ">"; return o; } template ostream& operator<< (ostream& o, const vector& v) { for (const auto& x : v) o << x << " "; return o; } ostream& operator<<(ostream& o, const unordered_map& m) { o << "{"; for (const auto& [k, v] : m) o << " " << k << ": " << v << ","; o << "}"; return o; } template istream& operator>> (istream& i, vector& v) { for (auto& x : v) i >> x; return i; } int main() { ios::sync_with_stdio(false); int n; string s; cin >> n >> s; unordered_set p {'n'}; for (char c : s) { unordered_set q; if (p.count('a') || p.count('o') || p.count('n')) { q.insert('w'); q.insert('n'); } if (p.count('w')) { q.insert('a'); q.insert('o'); } if (q.empty() || (c != '?' && !q.count(c))) { cout << "No" << endl; return 0; } p.clear(); if (c == '?') p = q; else p.insert(c); } cout << "Yes" << endl; return 0; }