N, A = map(int, input().split())
X = list(map(int, input().split()))
Y = [x - A for x in X]

dp = [0] * 5010
dp[2500] = 1

for y in Y:
    for i in range(5009, -1, -1):
        if i - y < 0 or i - y >= 5010:
            dp[i] = 0
        else:
            dp[i] += dp[i - y]
print(dp[2500] - 1)
