N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[[0 for k in range(50 * N + 1)] for j in range(N + 1)] for i in range(N + 1)]

for i in range(N):
    dp[i][0][0] = 1

for i in range(N):
    for j in range(N):
        for k in range(50 * N + 1):
            if k - X[i] >= 0:
                dp[i + 1][j + 1][k] += dp[i][j][k - X[i]]
            dp[i + 1][j + 1][k] += dp[i][j + 1][k]

res = 0

for j in range(N + 1):
    for k in range(50 * N + 1):
        if k == j * A:
            res += dp[N][j][k]

print(res)