n = gets.chomp.split(" ").map(&:to_i)
a = gets.chomp.split(" ").map(&:to_i)
sum = a.inject(:+)

ans = 0

for i in 1..(n[0]/2)
  a.combination(i).each do |t|
    count = t.inject(:+)
    ans += 1 if count == n[1] * t.size
    ans += 1 if sum - count == n[1] * (a.size - t.size) && i != n[0]/2
  end
end
p ans
