  n, a = gets.split.map(&:to_i)
  x = gets.split.map(&:to_i)
  sum = x.inject(:+)
  dp = Array.new(n + 1) { Array.new(n + 1) { Array.new(sum + 1) { 0 } } }

  dp[0][0][0] = 1
  (0..n).each do |i|
    (0..n).each do |j|
      (0..sum).each do |k|
        dp[i][j][k] = dp[i - 1][j][k] if i >= 1
        dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]] if i >= 1 && j >= 1 && k >= x[i - 1]
      end
    end
  end

  ans = 0
  (1..n).each do |j|
    break if j * a > sum

    ans += dp[n][j][j * a]
  end
  puts ans
