fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let n: usize = stdin.next().unwrap().parse().unwrap(); let _m: usize = stdin.next().unwrap().parse().unwrap(); let s: Vec = (0..n) .map(|_| stdin.next().unwrap().parse().unwrap()) .collect(); println!("{}", output(solve(s))); } fn solve(s: Vec) -> bool { const TARGET: &[u8] = "LOVE".as_bytes(); s.into_iter() .any(|s| s.into_bytes().windows(4).any(|s| s == TARGET)) } fn output(ans: bool) -> &'static str { match ans { true => "YES", false => "NO", } }