from collections import defaultdict

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

# dp[i][j]: i番目, j合計
dp = [defaultdict(int) for _ in range(N + 1)]
dp[0][0] = 1
for i in range(N):
    for key in dp[i]:
        dp[i + 1][key + x[i]] += dp[i][key]
        dp[i + 1][key] += dp[i][key]

print(dp[N][0] - 1)