n, a = [int(i) for i in input().split()]

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



nx = n * max(max(x), a)

y = [xi - a for xi in x]

dp = [[0 for j in range(2 * nx + 1)] for i in range(n + 1)]

dp[0][nx] = 1



for i in range(n):

    for j in range(2 * nx + 1):

        if not 0 <= j - y[i] <= 2 * nx:

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

        elif j - y[i] <= 2 * nx:

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



print((dp[n][nx] - 1))

n, a = [int(i) for i in input().split()]

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



nx = n * max(max(x), a)

y = [xi - a for xi in x]

dp = [[0 for j in range(2 * nx + 1)] for i in range(n + 1)]

dp[0][nx] = 1



for i in range(n):

    for j in range(2 * nx + 1):

        if j - y[i] > 2 * nx:

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

        else:

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



print((dp[n][nx] - 1))

n, a = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
nx = n * max(max(x), a)
y = [xi - a for xi in x]
dp = [[0 for j in range(2 * nx + 1)] for i in range(n + 1)]
dp[0][nx] = 1
for i in range(n):
    for j in range(2 * nx + 1):
        if not 0 <= j - y[i] <= 2 * nx:
            dp[i + 1][j] = dp[i][j]
        elif j - y[i] <= 2 * nx:
            dp[i + 1][j] = dp[i][j] + dp[i][j - y[i]]
print((dp[n][nx] - 1))

n, a = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
nx = n * max(max(x), a)
y = [xi - a for xi in x]
dp = [[0 for j in range(2 * nx + 1)] for i in range(n + 1)]
dp[0][nx] = 1
for i in range(n):
    for j in range(2 * nx + 1):
        if j - y[i] > 2 * nx:
            dp[i + 1][j] = dp[i][j]
        else:
            dp[i + 1][j] = dp[i][j] + dp[i][j - y[i]]
print((dp[n][nx] - 1))

-        if not 0 <= j - y[i] <= 2 * nx: +        if j - y[i] > 2 * nx: -        elif j - y[i] <= 2 * nx: +        else: