from sys import exit

def reads():
  return [int(x) for x in input().split()]

(N, A) = reads()
x = reads()

assert(N <= 16)

count = 0

for b in range(1, 1<<N):
  bits = [bool(b&(1 << i)) for i in range(N)]
  if sum(x[i] for i in range(N) if bits[i]) == A * sum(bits):
    count += 1
    # print(bits)

print(count)
