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

M = 2500
dp = [[0]*(2*M+1) for _ in range(N)]
dp[0][M] += 1
dp[0][X[0]+M] += 1

for i in range(1,N):
    for v in range(-M, M+1):
        dp[i][v+M] += dp[i-1][v+M]
        if -M<=v-X[i]<=M:
            dp[i][v+M] += dp[i-1][v-X[i]+M]

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