N, A = map(int, input().split())
X = list(map(lambda x:int(x)-A, input().split()))
dp = [0]*10000
dp[0] = 1
for i in range(N):
  new_dp = dp[:]
  for j in range(-3000,3000):
    if dp[j]>0:
      new_dp[j+X[i]] += dp[j]
  dp = new_dp
print(dp[0]-1)
