// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include using namespace std; #include using namespace atcoder; #include #include #include namespace mp = boost::multiprecision; using Bint = mp::cpp_int; using Real = mp::number>; using Rat = boost::rational; typedef long long ll; const ll INF = 1e18; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define rrep(i, n) for (ll i = ll(n) - 1; i >= 0; --i) #define all(v) v.begin(), v.end() #define llpow(x, y) (ll) pow(x, y) #define llacumulate(v) accumulate(all(v), 0LL) #define endl "\n" #define popcount __builtin_popcount const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; using vl = vector; using vvl = vector>; using vs = vector; void YN(bool b) { cout << (b ? "Yes" : "No") << endl; } void Yes() { cout << "Yes" << endl; } void No() { cout << "No" << endl; } struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } fast; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } template inline void print(const T &x) { cout << x << "\n"; } template inline void print(const vector &v, string s = " ") { rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n"); } template inline void print(const vector> &v) { for (auto &&p : v) print(p); } template inline void print(const pair &p) { cout << p.first << " " << p.second << endl; } template inline void print(const vector> &v) { for (auto &&p : v) print(p); } #ifdef LOCAL #include #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif int main() { ll n; string s; cin >> n >> s; bool flag = false; rep(i, s.size()) { char x = s[i]; if (x == 'w') { flag = true; } else if (x == 'a' || x == 'o') { if (flag) flag = false; else { if (i != 0 && s[i - 1] == '?') { flag = false; } else { No(); return 0; } } } else if (x == 'n') { if (flag) { No(); return 0; } } else if (x == '?') { if(i!=0&&s[i-1]=='w'){ s[i] = 'a'; } flag = false; } else { No(); return 0; } } Yes(); }