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

def dfs(a, b, c):
  #print("{0} {1} {2}".format(a, b, c))
  r = 0
  if c == N:
    if b > 0 and a == b*A:
      #print("{0} {1} {2} ok".format(a, b, c))
      return 1
    return 0
  r += dfs(a+x[c], b+1, c+1)
  r += dfs(a, b, c+1)
  return r

print(dfs(0, 0, 0))
