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
(1..n).each do |i|
  (0..n).each do |j|
    (0..sum).each do |k|
      dp[i][j][k] =
        if j >= 1 && k >= x[i - 1]
          dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]]
        else
          dp[i - 1][j][k]
        end
    end
  end
end
ans = 0
(1..n).each do |j|
  break if j * a > sum
  ans += dp[n][j][j * a]
end
puts ans
