import numpy as np

N, A = map(int, input().split())
intA = lambda x: int(x) - A
X = tuple(map(intA, input().split()))

dp = np.zeros(5001, dtype=np.int64)
for x in X:
    if x > 0:
        dp[x:] += dp[:-x]
    elif x < 0:
        dp[:x] += dp[-x:]
    else:
        dp *= 2
    dp[x + 2500] += 1
print(dp[2500])
