N, A = map(int, input().split())
x = []
x = list(map(int, input().split()))

dp = [[[0 for i in range(2555)] for j in range(55)] for k in range(55)]

dp[0][0][0] = 1

for i in range(N):
    for j in range(N):
        for k in range(2501):
            if dp[i][j][k] <= 0:
                continue
            dp[i+1][j][k] += dp[i][j][k]
            dp[i+1][j+1][k+x[i]] += dp[i][j][k]

res = 0
for i in range(1, N+1):
    res += dp[N][i][i*A]
print(res)
