N, A, *x = list(map(int, open(0).read().split()))



c_nx = N * max(x + [A])

dp = [[[0] * (c_nx + 1) for _ in range(N + 1)] 

      for _ in range(N + 1)]

x = [0] + x



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

for j in range(1, N + 1):

    for k in range(N + 1):

        for s in range(c_nx + 1):

            if s < x[j]:

                dp[j][k][s] = dp[j - 1][k][s]

            elif s >= x[j]:

                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]]

                

print((sum(dp[N][k][k * A] for k in range(1, N + 1))))
N, A, *x = list(map(int, open(0).read().split()))



NX = N * max(x + [A])

y = [0] + [v - A for v in x]

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



dp[0][NX] = 1  

for j in range(1, N + 1):

    for t in range(2 * NX + 1):

        if t - y[j] < 0 or t - y[j] > 2 * NX:

            dp[j][t] = dp[j - 1][t]

        elif 0 <= t - y[j] <= 2 * NX:

            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]]

                

print((dp[N][NX] - 1))

N, A, *x = list(map(int, open(0).read().split()))
c_nx = N * max(x + [A])
dp = [[[0] * (c_nx + 1) for _ in range(N + 1)] for _ in range(N + 1)]
x = [0] + x
dp[0][0][0] = 1
for j in range(1, N + 1):
    for k in range(N + 1):
        for s in range(c_nx + 1):
            if s < x[j]:
                dp[j][k][s] = dp[j - 1][k][s]
            elif s >= x[j]:
                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]]
print((sum(dp[N][k][k * A] for k in range(1, N + 1))))

N, A, *x = list(map(int, open(0).read().split()))
NX = N * max(x + [A])
y = [0] + [v - A for v in x]
dp = [[0] * (2 * NX + 1) for _ in range(N + 1)]
dp[0][NX] = 1
for j in range(1, N + 1):
    for t in range(2 * NX + 1):
        if t - y[j] < 0 or t - y[j] > 2 * NX:
            dp[j][t] = dp[j - 1][t]
        elif 0 <= t - y[j] <= 2 * NX:
            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]]
print((dp[N][NX] - 1))

-c_nx = N * max(x + [A]) -dp = [[[0] * (c_nx + 1) for _ in range(N + 1)] for _ in range(N + 1)] -x = [0] + x -dp[0][0][0] = 1 +NX = N * max(x + [A]) +y = [0] + [v - A for v in x] +dp = [[0] * (2 * NX + 1) for _ in range(N + 1)] +dp[0][NX] = 1 -    for k in range(N + 1): -        for s in range(c_nx + 1): -            if s < x[j]: -                dp[j][k][s] = dp[j - 1][k][s] -            elif s >= x[j]: -                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j]] -print((sum(dp[N][k][k * A] for k in range(1, N + 1)))) +    for t in range(2 * NX + 1): +        if t - y[j] < 0 or t - y[j] > 2 * NX: +            dp[j][t] = dp[j - 1][t] +        elif 0 <= t - y[j] <= 2 * NX: +            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]] +print((dp[N][NX] - 1))