n, a = gets.chomp.split(" ").map(&:to_i)
x = gets.chomp.split(" ").map(&:to_i)
xmax = (x + [a]).max
dp = Array.new(n+1){Array.new(n+1){Array.new(n*xmax + 1, 0)}}
(0..n).each do |j|
  (0..n).each do |k|
    (0..(n*xmax)).each do |s|
      if j == 0 && k == 0 && s == 0 then
        dp[0][0][0] = 1
      elsif j >= 1 && s < x[j-1] then
        dp[j][k][s] = dp[j-1][k][s]
      elsif j >= 1 && k >= 1 && s >= x[j-1] then
        dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j-1]]
      end
    end
  end
end

ret = 0
(1..n).each do |k|
  ret += dp[n][k][k*a]
end
puts ret