use std::collections::HashMap; const MOD: usize = 1e9 as usize + 7; fn main() { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec<usize> = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut dp = vec![HashMap::new(); n+1]; dp[0].insert(0usize, 1usize); for i in 0..n { let mut next_dp = vec![HashMap::new(); n+1]; for j in 0..=n { for (&sumval, &cnt) in dp[j].iter() { *next_dp[j].entry(sumval).or_insert(0usize) += cnt; *next_dp[j].entry(sumval).or_insert(0usize) %= MOD; *next_dp[j+1].entry(sumval+a[i]).or_insert(0usize) += cnt; *next_dp[j+1].entry(sumval+a[i]).or_insert(0usize) %= MOD; } } dp = next_dp; } let result = dp.iter().enumerate().skip(1) .map(|(i, v)| v.iter().filter(|&(&sumval, _)| sumval >= i*k).map(|(_, &cnt)| cnt).sum::<usize>()) .sum::<usize>() % MOD; println!("{}", result); }