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

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



#解法2



iMX = max(aX + [iA])

dp = [[0]*(2 * iN*iMX + 1) for _ in range(iN+1)]



for j in range(0,iN+1):

    for t in range(0,2*iN*iMX):

        if j == 0 and t == iN * iMX :

            dp[j][t] = 1

        elif j >= 0 and ( t - aX[j-1] < 0 or t - aX[j-1] > 2*iN*iMX):

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

        elif j >= 0 and ( 0 <= t - aX[j-1] <= 2*iN*iMX):

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

        else:

            dp[j][t] = 0

print((dp[iN][iN*iMX] -1 ))

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

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



#解法2そのまま



iMX = max(aX + [iA])

iULim = iN*iMX

iULim2 = 2*iULim



#y0..yjから0枚以上選んだ合計をt-iN*iMXにするような選び方の総数

dp = [[0]*(iULim2 + 1) for _ in range(iN+1)]

for j in range(0,iN+1):

    for t in range(0,iULim2):

        if j == 0 and t == iULim :

            dp[j][t] = 1

        elif  t - aX[j-1] < 0 or t - aX[j-1] > iULim2:

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

        elif  0 <= t - aX[j-1] <= iULim2:

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

        else:

            dp[j][t] = 0

print((dp[iN][iN*iMX] -1 ))

iN, iA = [int(x) for x in input().split()]
aX = [int(x) - iA for x in input().split()]
# 解法2
iMX = max(aX + [iA])
dp = [[0] * (2 * iN * iMX + 1) for _ in range(iN + 1)]
for j in range(0, iN + 1):
    for t in range(0, 2 * iN * iMX):
        if j == 0 and t == iN * iMX:
            dp[j][t] = 1
        elif j >= 0 and (t - aX[j - 1] < 0 or t - aX[j - 1] > 2 * iN * iMX):
            dp[j][t] = dp[j - 1][t]
        elif j >= 0 and (0 <= t - aX[j - 1] <= 2 * iN * iMX):
            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - aX[j - 1]]
        else:
            dp[j][t] = 0
print((dp[iN][iN * iMX] - 1))

iN, iA = [int(x) for x in input().split()]
aX = [int(x) - iA for x in input().split()]
# 解法2そのまま
iMX = max(aX + [iA])
iULim = iN * iMX
iULim2 = 2 * iULim
# y0..yjから0枚以上選んだ合計をt-iN*iMXにするような選び方の総数
dp = [[0] * (iULim2 + 1) for _ in range(iN + 1)]
for j in range(0, iN + 1):
    for t in range(0, iULim2):
        if j == 0 and t == iULim:
            dp[j][t] = 1
        elif t - aX[j - 1] < 0 or t - aX[j - 1] > iULim2:
            dp[j][t] = dp[j - 1][t]
        elif 0 <= t - aX[j - 1] <= iULim2:
            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - aX[j - 1]]
        else:
            dp[j][t] = 0
print((dp[iN][iN * iMX] - 1))

-# 解法2 +# 解法2そのまま -dp = [[0] * (2 * iN * iMX + 1) for _ in range(iN + 1)] +iULim = iN * iMX +iULim2 = 2 * iULim +# y0..yjから0枚以上選んだ合計をt-iN*iMXにするような選び方の総数 +dp = [[0] * (iULim2 + 1) for _ in range(iN + 1)] -    for t in range(0, 2 * iN * iMX): -        if j == 0 and t == iN * iMX: +    for t in range(0, iULim2): +        if j == 0 and t == iULim: -        elif j >= 0 and (t - aX[j - 1] < 0 or t - aX[j - 1] > 2 * iN * iMX): +        elif t - aX[j - 1] < 0 or t - aX[j - 1] > iULim2: -        elif j >= 0 and (0 <= t - aX[j - 1] <= 2 * iN * iMX): +        elif 0 <= t - aX[j - 1] <= iULim2: