N, A = map(int, input().split())
X = list(map(int, input().split()))
X = list(map(lambda x: x - A, X))
maxx = max(max(X), -min(X))
#前から(i + 1)個見て、和が(j - N * maxx)のもの
dp = [[0] * (2 * N * maxx + 1) for _ in range(N + 1)]
dp[0][N * maxx] = 1
for i in range(N):
  for j in range(2 * N * maxx + 1):
    if 0 <= j + X[i] <= 2 * N * maxx:
      dp[i + 1][j + X[i]] = dp[i][j] + dp[i][j + X[i]]
    else:
      dp[i + 1][j] = dp[i][j]
print(dp[N][N * maxx] - 1)
#print(dp)
#print(X)