fn main() { let (_n, k) = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse::().unwrap(), iter.next().unwrap().parse::().unwrap(), ) }; let aa: Vec<_> = { let mut line = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|x| x.parse::().unwrap()) .collect() }; let mut dp = vec![(0, 0)]; for &a in &aa { for i in 0..dp.len() { let (s, cnt) = dp[i]; if cnt < k { dp.push((s + a, cnt + 1)); } } } let ans = dp .iter() .filter(|&&(s, cnt)| cnt == k && s % 998244353 <= s % 998) .count() % 998; println!("{}", ans); }