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()]

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

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

l_zero = len(X) - len(X_plus) - len(X_minus)

s_plus = sum(X_plus)

s_minus = sum(X_minus)

dp_plus = {0: 1}

dp_minus = {0: 1}

for p in X_plus:

    dp_plus_old = dp_plus.copy()

    for k, v in list(dp_plus_old.items()):

        dp_plus[k + p] = dp_plus_old.get(k, 0) + dp_plus_old.get(k + p, 0)

for m in X_minus:

    dp_minus_old = dp_minus.copy()

    for k, v in list(dp_minus_old.items()):

        dp_minus[k + m] = dp_minus_old.get(k, 0) + dp_minus_old.get(k + m, 0)

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.get(j, 0) * dp_minus.get(j, 0)

print(ans)

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()]
X_plus = [_ for _ in X if _ > 0]
X_minus = [-_ for _ in X if _ < 0]
l_zero = len(X) - len(X_plus) - len(X_minus)
s_plus = sum(X_plus)
s_minus = sum(X_minus)
dp_plus = {0: 1}
dp_minus = {0: 1}
for p in X_plus:
    dp_plus_old = dp_plus.copy()
    for k, v in list(dp_plus_old.items()):
        dp_plus[k + p] = dp_plus_old.get(k, 0) + dp_plus_old.get(k + p, 0)
for m in X_minus:
    dp_minus_old = dp_minus.copy()
    for k, v in list(dp_minus_old.items()):
        dp_minus[k + m] = dp_minus_old.get(k, 0) + dp_minus_old.get(k + m, 0)
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.get(j, 0) * dp_minus.get(j, 0)
print(ans)

-l_plus = len(X_plus) -l_minus = len(X_minus) -l_zero = len(X) - l_plus - l_minus +l_zero = len(X) - len(X_plus) - len(X_minus) -dp_plus = [1] + [0] * s_plus -dp_minus = [1] + [0] * s_minus -for i in range(l_plus): +dp_plus = {0: 1} +dp_minus = {0: 1} +for p in X_plus: -    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): +    for k, v in list(dp_plus_old.items()): +        dp_plus[k + p] = dp_plus_old.get(k, 0) + dp_plus_old.get(k + p, 0) +for m in X_minus: -    for j in range(s_minus + 1 - X_minus[i]): -        dp_minus[j + X_minus[i]] += dp_minus_old[j] +    for k, v in list(dp_minus_old.items()): +        dp_minus[k + m] = dp_minus_old.get(k, 0) + dp_minus_old.get(k + m, 0) -    ans += c_zero * dp_plus[j] * dp_minus[j] +    ans += c_zero * dp_plus.get(j, 0) * dp_minus.get(j, 0)