from itertools import product



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

x = [int(x) for x in input().split()]



X = max(max(x), A)

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

dp[0][N * X] = 1



for j, t in product(list(range(1, N + 1)), list(range(2 * N * X + 1))):

    y = x[j - 1] - A

    if t - y < 0 or t - y > 2 * N * X:

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

    elif 0 <= t - y <= 2 * N * X:

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

print((dp[N][N * X] - 1))
from collections import defaultdict



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

x = [int(x) for x in input().split()]



for i in range(N):

    x[i] -= A

X = max(max(x), A)



dp = [defaultdict(int) for _ in range(N + 1)]

dp[0][0] = 1

for i in range(N):

    for j in range(-N * X, N * X + 1):

        if - N * X <= j - x[i] <= N * X:

            dp[i + 1][j] = dp[i][j] + dp[i][j - x[i]]

        else:

            dp[i + 1][j] = dp[i][j]

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

from itertools import product

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

from collections import defaultdict

N, A = list(map(int, input().split()))
x = [int(x) for x in input().split()]
for i in range(N):
    x[i] -= A
X = max(max(x), A)
dp = [defaultdict(int) for _ in range(N + 1)]
dp[0][0] = 1
for i in range(N):
    for j in range(-N * X, N * X + 1):
        if -N * X <= j - x[i] <= N * X:
            dp[i + 1][j] = dp[i][j] + dp[i][j - x[i]]
        else:
            dp[i + 1][j] = dp[i][j]
print((dp[N][0] - 1))

-from itertools import product +from collections import defaultdict +for i in range(N): +    x[i] -= A -dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)] -dp[0][N * X] = 1 -for j, t in product(list(range(1, N + 1)), list(range(2 * N * X + 1))): -    y = x[j - 1] - A -    if t - y < 0 or t - y > 2 * N * X: -        dp[j][t] = dp[j - 1][t] -    elif 0 <= t - y <= 2 * N * X: -        dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y] -print((dp[N][N * X] - 1)) +dp = [defaultdict(int) for _ in range(N + 1)] +dp[0][0] = 1 +for i in range(N): +    for j in range(-N * X, N * X + 1): +        if -N * X <= j - x[i] <= N * X: +            dp[i + 1][j] = dp[i][j] + dp[i][j - x[i]] +        else: +            dp[i + 1][j] = dp[i][j] +print((dp[N][0] - 1))