OFS = 2500
MAX = 2*OFS + 1
N, A = map(int, input().split())
X = [x-A for x in map(int, input().split())]

dp = [[0]*MAX for _ in [0]*(N+1)]
dp[0][OFS] = 1

for i in range(1, N+1):
    x = X[i-1]
    for j in range(MAX-1, -1, -1):
        if 0 <= j-x < MAX:
            dp[i][j] = dp[i-1][j] + dp[i-1][j-x]

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