const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('line', (line) => { const N = parseInt(line); rl.on('line', (line) => { const S = line.trim(); const dp = new Array(N).fill(false).map(() => new Array(26).fill(false)); if (S[0] === '?') { for (let j = 0; j < 26; j++) { dp[0][j] = true; } } if (S[0] === 'n') { dp[0]['n'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; } if (S[0] === 'w') { dp[0]['w'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; } if (S[0] === 'a' || S[0] === 'o') { console.log("No"); process.exit(0); } for (let i = 1; i < N; i++) { for (let j = 0; j < 26; j++) { if (dp[i - 1][j] === true) { if (j === 'w'.charCodeAt(0) - 'a'.charCodeAt(0)) { if (S[i] === 'a') dp[i]['a'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; if (S[i] === 'o') dp[i]['o'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; if (S[i] === '?') { dp[i]['a'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; dp[i]['o'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; } } else { if (S[i] === 'w') dp[i]['w'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; if (S[i] === 'n') dp[i]['n'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; if (S[i] === '?') { dp[i]['w'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; dp[i]['n'.charCodeAt(0) - 'a'.charCodeAt(0)] = true; } } } } } let ans = false; if (dp[N - 1]['a'.charCodeAt(0) - 'a'.charCodeAt(0)]) ans = true; if (dp[N - 1]['o'.charCodeAt(0) - 'a'.charCodeAt(0)]) ans = true; if (dp[N - 1]['n'.charCodeAt(0) - 'a'.charCodeAt(0)]) ans = true; if (ans === true) console.log("Yes"); else console.log("No"); process.exit(0); }); });