use std::io::*; use std::str::FromStr; const MOD: i32 = 1_000_000_007_i32; fn main() { let mut s = String::new(); stdin().read_line(&mut s).ok(); let mut itr = s.split_whitespace().map(|x| i32::from_str(x).unwrap()); let (n, k) = (itr.next().unwrap(), itr.next().unwrap()); s.clear(); stdin().read_line(&mut s).ok(); let mut itr = s.split_whitespace().map(|x| i32::from_str(x).unwrap()); let mut v = Vec::new(); for _i in 0..n { v.push(itr.next().unwrap()); } let mut dp = vec![vec![0_i32; 105]; 20005]; let base = 10002; dp[base + 0][0] = 1; for j in 0..n { let x = v[j as usize] - k; for i in 0..20005 { if i + x < 0 || i + x >= 20005 { continue; } dp[i as usize][(j + 1) as usize] += dp[i as usize][j as usize]; dp[i as usize][(j + 1) as usize] %= MOD; dp[(i + x) as usize][(j + 1) as usize] += dp[i as usize][j as usize]; dp[(i + x) as usize][(j + 1) as usize] %= MOD; } } let mut ret = 0; for i in base..20005 { ret += dp[i as usize][n as usize]; ret %= MOD; } println!("{}", (ret + MOD - 1) % MOD); }