n, a = gets.chomp.split(' ').map(&:to_i)
arr = gets.chomp.split(' ').map(&:to_i)
total = arr.inject(:+)
dp = Array.new(n + 1)
(n + 1).times do |i|
  dp[i] = Array.new(n + 1)
  (n + 1).times do |j|
    dp[i][j] = Array.new(total + 1, 0)
  end
end
dp[0][0][0] = 1
(0..n).each do |i|
  (0..n).each do |j|
    (0..total).each do |k|
      if k - arr[i - 1] >= 0 && i > 0 && j > 0
        dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - arr[i - 1]]
      elsif i > 0
        dp[i][j][k] = dp[i - 1][j][k]
      end
    end
  end
end
count = 0
dp[n].each_with_index do |row1, idx1|
  next if idx1 == 0
  row1.each_with_index do |row2, idx2|
    count += row2 if a * idx1 == idx2
  end
end
puts count