N, A = gets.chomp.split(" ").map(&:to_i)
x = gets.chomp.split(" ").map(&:to_i)
K_MAX = x.max*N + 1
dp = Array.new(N+1){Array.new(N+1){Array.new(K_MAX, 0)}}
dp[0][0][0] = 1
(N+1).times do |i|
  (N+1).times do |j|
    K_MAX.times do |k|
      next if i < 1
      if k < x[i-1] then
        dp[i][j][k] = dp[i-1][j][k]
      elsif k >= 1
        dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k - x[i-1]]
      end
    end
  end
end

ret = 0
(1..N).each do |j|
  ret += dp[N][j][j*A]
end
puts ret
