fn g() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().chars().collect() } fn main() { g(); let mut s = g(); s.push('n'); s.push('n'); let c = "aonw?"; if !"nw?".contains(s[0]) || !c.contains(s[1]) { println!("No"); return; } for i in 1..s.len() - 1 { if !c.contains(s[i + 1]) { println!("No"); return; } match (s[i - 1], s[i], s[i + 1]) { ('w', '?', 'a') | ('w', '?', 'o') | ('w', 'w', _) | ('w', 'n', _) | ('n', 'a', _) | ('n', 'o', _) | (_, 'w', 'n') | (_, 'w', 'w') | (_, 'a', 'a') | (_, 'a', 'o') | (_, 'o', 'a') | (_, 'o', 'o') | (_, 'n', 'a') | (_, 'n', 'o') => { println!("No"); return; } _ => {} } } println!("Yes") }