#[allow(unused_imports)]
use {
   proconio::{fastout, input, marker::*},
   std::cmp::*,
   std::collections::*,
};

fn main() {
   input! {
      n: usize,
      a: usize,
      x: [usize; n]
   }
   let num = 50 * n;
   let mut dp = vec![vec![vec![0usize; num + 1]; n + 1]; n + 1];
   dp[0][0][0] = 1;
   for i in 0..n {
      for j in 0..n {
         for k in 0..=num {
            dp[i + 1][j][k] = dp[i][j][k];
            if j > 0 && k >= x[i] {
               dp[i + 1][j][k] += dp[i][j - 1][k - x[i]];
            }
         }
      }
   }
   let mut ans = 0;
   for i in 1..=n {
      ans += dp[n][i][i * a];
   }
   println!("{}", ans);
}
