use std::collections::VecDeque; use proconio::input; fn main () { input! { n: usize, k: usize, mut a: [usize; n], } a.sort(); let mut b: VecDeque<_> = VecDeque::from(a); let mut joker = 0; while let Some(&f) = b.front() { if f == 0 { joker += 1; b.pop_front(); } else { break; } } let diff = k - joker; if diff <= 0 { println!("Yes"); } else if b.is_empty() { println!("No"); } else { let c = Vec::from(b); let flag = c.windows(diff) .fold (false, |f, window| { if f { f } else { let flag = window.iter() .fold(true, |g, &v| { if v != window[0] { false } else { g } }); flag } }); if flag { println!("Yes"); } else { println!("No"); } } }