/* -*- coding: utf-8 -*- * * 2373.cc: No.2373 wa, wo, n - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 200000; /* typedef */ /* global variables */ char s[MAX_N + 4]; bool dp[MAX_N + 1]; /* subroutines */ /* main */ int main() { int n; scanf("%d%s", &n, s); dp[0] = true; for (int i = 0; i < n; i++) if (dp[i]) { if (s[i] == 'n' || s[i] == '?') dp[i + 1] = true; if (i + 2 <= n && (s[i] == 'w' || s[i] == '?') && (s[i + 1] == 'a' || s[i + 1] == 'o' || s[i + 1] == '?')) dp[i + 2] = true; } if (dp[n]) puts("Yes"); else puts("No"); return 0; }