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:
    r = []
    if y >= 0:
        r = range(5009, -1, -1)
    else:
        r = range(5010)
    for i in r:
        if i - y < 0 or i - y >= 5010:
            continue
        dp[i] += dp[i - y]
print(dp[2500] - 1)
