N, A = map(int, input().split())
xs = list(map(int, input().split()))

# 平均を A にしたいので、
# 先に A を引いて、平均を 0 にすることを目指す

xs = [x - A for x in xs]

count = 0

for i in range(2 ** N):
  string = "{:0" + str(N) + "b}"
  use = string.format(i)[::-1]

  ans = 0
  for i, flag in enumerate(use):
    if flag == "1":
      ans += xs[i]
    else:
      pass
  if ans == 0:
    count += 1
  
if A != 0:
  count -= 1
    
print(count)