N, A = [int(_) for _ in input().split()]

X = [int(_) - A for _ in input().split()]

M = max(X + [A])

dp = [0] * (2 * N * M + 1)

dp[N * M] = 1

for x in X:

    dp_old = dp.copy()

    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)):

        dp[i + x] += dp_old[i]

print((dp[N * M] - 1))

N, A = [int(_) for _ in input().split()]

X = [int(_) - A for _ in input().split()]

X_plus = [_ for _ in X if _ > 0]

X_minus = [-_ for _ in X if _ < 0]

l_plus = len(X_plus)

l_minus = len(X_minus)

l_zero = len(X) - l_plus - l_minus

s_plus = sum(X_plus)

s_minus = sum(X_minus)

dp_plus = [1] + [0] * s_plus

dp_minus = [1] + [0] * s_minus

for i in range(l_plus):

    dp_plus_old = dp_plus.copy()

    for j in range(s_plus + 1 - X_plus[i]):

        dp_plus[j + X_plus[i]] += dp_plus_old[j]

for i in range(l_minus):

    dp_minus_old = dp_minus.copy()

    for j in range(s_minus + 1 - X_minus[i]):

        dp_minus[j + X_minus[i]] += dp_minus_old[j]

c_zero = 2 ** l_zero

ans = c_zero - 1

for j in range(1, min(s_plus, s_minus) + 1):

    ans += c_zero * dp_plus[j] * dp_minus[j]

print(ans)

N, A = [int(_) for _ in input().split()]
X = [int(_) - A for _ in input().split()]
M = max(X + [A])
dp = [0] * (2 * N * M + 1)
dp[N * M] = 1
for x in X:
    dp_old = dp.copy()
    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)):
        dp[i + x] += dp_old[i]
print((dp[N * M] - 1))

N, A = [int(_) for _ in input().split()]
X = [int(_) - A for _ in input().split()]
X_plus = [_ for _ in X if _ > 0]
X_minus = [-_ for _ in X if _ < 0]
l_plus = len(X_plus)
l_minus = len(X_minus)
l_zero = len(X) - l_plus - l_minus
s_plus = sum(X_plus)
s_minus = sum(X_minus)
dp_plus = [1] + [0] * s_plus
dp_minus = [1] + [0] * s_minus
for i in range(l_plus):
    dp_plus_old = dp_plus.copy()
    for j in range(s_plus + 1 - X_plus[i]):
        dp_plus[j + X_plus[i]] += dp_plus_old[j]
for i in range(l_minus):
    dp_minus_old = dp_minus.copy()
    for j in range(s_minus + 1 - X_minus[i]):
        dp_minus[j + X_minus[i]] += dp_minus_old[j]
c_zero = 2**l_zero
ans = c_zero - 1
for j in range(1, min(s_plus, s_minus) + 1):
    ans += c_zero * dp_plus[j] * dp_minus[j]
print(ans)

-M = max(X + [A]) -dp = [0] * (2 * N * M + 1) -dp[N * M] = 1 -for x in X: -    dp_old = dp.copy() -    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)): -        dp[i + x] += dp_old[i] -print((dp[N * M] - 1)) +X_plus = [_ for _ in X if _ > 0] +X_minus = [-_ for _ in X if _ < 0] +l_plus = len(X_plus) +l_minus = len(X_minus) +l_zero = len(X) - l_plus - l_minus +s_plus = sum(X_plus) +s_minus = sum(X_minus) +dp_plus = [1] + [0] * s_plus +dp_minus = [1] + [0] * s_minus +for i in range(l_plus): +    dp_plus_old = dp_plus.copy() +    for j in range(s_plus + 1 - X_plus[i]): +        dp_plus[j + X_plus[i]] += dp_plus_old[j] +for i in range(l_minus): +    dp_minus_old = dp_minus.copy() +    for j in range(s_minus + 1 - X_minus[i]): +        dp_minus[j + X_minus[i]] += dp_minus_old[j] +c_zero = 2**l_zero +ans = c_zero - 1 +for j in range(1, min(s_plus, s_minus) + 1): +    ans += c_zero * dp_plus[j] * dp_minus[j] +print(ans)