N,A = map(int,input().split())
X = map(int,input().split())
X = [x-A for x in X]
dp = [[0]*(5001) for _ in range(N+1)]
dp[0][2500] = 1
for i in range(1,N+1):
    x = X[i-1]
    for j in range(5001):
        dp[i][j] += dp[i-1][j]
        if 0<=j-x<5001:
            dp[i][j] += dp[i-1][j-x]

print(dp[-1][2500]-1)

