#include using namespace std; int main () { int N; cin >> N; bool ok[4] = {true, false, false, false}; bool G[4][4] = { {false, true, true, false}, {false, false, true, true}, {false, true, true, false}, {false, true, true, false}}; string key = "?wnao"; for (int i = 0; i < N; i ++) { char c; cin >> c; bool did = false; for (int j = 0; j < 5; j ++) { if (key[j] != c) { continue; } if (j) { j = min(j, 3); bool ok2[4]; for (int k = 0; k < 4; k ++) { ok2[k] = false; } for (int k = 0; k < 4; k ++) { ok2[j] = ok2[j] || (ok[k] && G[k][j]); } for (int k = 0; k < 4; k ++) { ok[k] = ok2[k]; } } else { bool ok2[4]; for (int k = 0; k < 4; k ++) { ok2[k] = false; for (int l = 0; l < 4; l ++) { ok2[k] = ok2[k] || (ok[l] && G[l][k]); } } for (int k = 0; k < 4; k ++) ok[k] = ok2[k]; } did = true; break; } if (!did) { puts("No"); return 0; } } if (ok[0] || ok[1] || ok[2] || ok[3]) { puts("Yes"); } else { puts("No"); } }