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 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):

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

print((dp[N][0] - 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 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):
        dp[i + 1][j] = dp[i][j] + dp[i][j - x[i]]
print((dp[N][0] - 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] +        dp[i + 1][j] = dp[i][j] + dp[i][j - x[i]]