n, a = gets.split.map(&:to_i)
xs = gets.split.map(&:to_i)

count = 0
n.times do |i|
  xs.combination(i+1).each do |arr|
    avg = (arr.inject(&:+))/(i+1).to_f
    count += 1 if avg == a.to_f
  end
end

puts count
