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

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

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



#解法1



iMX = max(aX + [iA])

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



dp[0][0][0] = 1

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

#   for k in range(0,iN+1):

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

#       for s in range(0,iN*iMX + 1):

        for s in range(0,j*iMX + 1):

            if  s < aX[j-1]:

                dp[j][k][s] = dp[j-1][k][s]

            elif k >= 1 and  s >= aX[j-1]:

                dp[j][k][s] = dp[j-1][k][s]+dp[j-1][k-1][s- aX[j-1]]

            else:

                dp[j][k][s] = 0

iRet = 0

for k in range(1,iN+1):

    iRet += dp[iN][k][k*iA]

print(iRet)

#分割してみた。これで通るかな？

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

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

aPlus = [x for x in aX if 0 < x ]

aMinus = [-1 * x for x in aX if x < 0  ]

iLenPlus = len(aPlus)

iLenMinus = len(aMinus)

iLen0 = iN - iLenPlus - iLenMinus



def fnCr(iN,iR):

    if iN - iR < iR :

        iR = iN - iR

    if iN == 0 :

        return 0

    elif iR == 0:

        return 1

    elif iR == 1:

        return iN

    return iN / iR * fnCr(iN-1,iR-1)



aFr = [1]*(iN+1)

for i in range(1,iN+1):

    aFr[i] = aFr[i-1] * i





iCZero = 2**iLen0 - 1 #sum(k=1..N){nCk} = 2^n -1



iRet = 0

iRet += iCZero

iCZero += 1 #0の場合を追加



iSumPlus = sum(aPlus)

iSumMinus = sum(aMinus)

iUlim = min(iSumPlus , iSumMinus)

iOlim = max(iSumPlus , iSumMinus)

if 0 < iUlim:

    dp1 = [[0]*(iOlim +1) for _ in range(iLenPlus)]

    dp1[0][0] = 1

    dp1[0][aPlus[0]]=1

    for j in range(1,iLenPlus):

        for k in range(iUlim + 1):

            if k < aPlus[j] :

                dp1[j][k] = dp1[j-1][k]

            else:

                dp1[j][k] = dp1[j-1][k] + dp1[j-1][k-aPlus[j]]



    dp2 = [[0]*(iOlim +1) for _ in range(iLenMinus)]

    dp2[0][0] = 1

    dp2[0][aMinus[0]]=1

    for j in range(1,iLenMinus):

        for k in range(iUlim + 1):

            if k < aMinus[j] :

                dp2[j][k] = dp2[j-1][k]

            else:

                dp2[j][k] = dp2[j-1][k] + dp2[j-1][k-aMinus[j]]

    for i in range(1,iUlim+1):

        iRet += iCZero * dp1[-1][i] * dp2[-1][i]



print(iRet)

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

# 分割してみた。これで通るかな？
iN, iA = [int(x) for x in input().split()]
aX = [int(x) - iA for x in input().split()]
aPlus = [x for x in aX if 0 < x]
aMinus = [-1 * x for x in aX if x < 0]
iLenPlus = len(aPlus)
iLenMinus = len(aMinus)
iLen0 = iN - iLenPlus - iLenMinus


def fnCr(iN, iR):
    if iN - iR < iR:
        iR = iN - iR
    if iN == 0:
        return 0
    elif iR == 0:
        return 1
    elif iR == 1:
        return iN
    return iN / iR * fnCr(iN - 1, iR - 1)


aFr = [1] * (iN + 1)
for i in range(1, iN + 1):
    aFr[i] = aFr[i - 1] * i
iCZero = 2**iLen0 - 1  # sum(k=1..N){nCk} = 2^n -1
iRet = 0
iRet += iCZero
iCZero += 1  # 0の場合を追加
iSumPlus = sum(aPlus)
iSumMinus = sum(aMinus)
iUlim = min(iSumPlus, iSumMinus)
iOlim = max(iSumPlus, iSumMinus)
if 0 < iUlim:
    dp1 = [[0] * (iOlim + 1) for _ in range(iLenPlus)]
    dp1[0][0] = 1
    dp1[0][aPlus[0]] = 1
    for j in range(1, iLenPlus):
        for k in range(iUlim + 1):
            if k < aPlus[j]:
                dp1[j][k] = dp1[j - 1][k]
            else:
                dp1[j][k] = dp1[j - 1][k] + dp1[j - 1][k - aPlus[j]]
    dp2 = [[0] * (iOlim + 1) for _ in range(iLenMinus)]
    dp2[0][0] = 1
    dp2[0][aMinus[0]] = 1
    for j in range(1, iLenMinus):
        for k in range(iUlim + 1):
            if k < aMinus[j]:
                dp2[j][k] = dp2[j - 1][k]
            else:
                dp2[j][k] = dp2[j - 1][k] + dp2[j - 1][k - aMinus[j]]
    for i in range(1, iUlim + 1):
        iRet += iCZero * dp1[-1][i] * dp2[-1][i]
print(iRet)

+# 分割してみた。これで通るかな？ -# aX = [int(x) - iA for x in input().split()] -aX = [int(x) for x in input().split()] -# 解法1 -iMX = max(aX + [iA]) -dp = [[[0] * (iN * iMX + 1) for _ in range(iN + 1)] for _ in range(iN + 1)] -dp[0][0][0] = 1 -for j in range(1, iN + 1): -    #   for k in range(0,iN+1): -    for k in range(0, j + 1): -        #       for s in range(0,iN*iMX + 1): -        for s in range(0, j * iMX + 1): -            if s < aX[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] -            elif k >= 1 and s >= aX[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - aX[j - 1]] +aX = [int(x) - iA for x in input().split()] +aPlus = [x for x in aX if 0 < x] +aMinus = [-1 * x for x in aX if x < 0] +iLenPlus = len(aPlus) +iLenMinus = len(aMinus) +iLen0 = iN - iLenPlus - iLenMinus + + +def fnCr(iN, iR): +    if iN - iR < iR: +        iR = iN - iR +    if iN == 0: +        return 0 +    elif iR == 0: +        return 1 +    elif iR == 1: +        return iN +    return iN / iR * fnCr(iN - 1, iR - 1) + + +aFr = [1] * (iN + 1) +for i in range(1, iN + 1): +    aFr[i] = aFr[i - 1] * i +iCZero = 2**iLen0 - 1  # sum(k=1..N){nCk} = 2^n -1 +iRet = 0 +iRet += iCZero +iCZero += 1  # 0の場合を追加 +iSumPlus = sum(aPlus) +iSumMinus = sum(aMinus) +iUlim = min(iSumPlus, iSumMinus) +iOlim = max(iSumPlus, iSumMinus) +if 0 < iUlim: +    dp1 = [[0] * (iOlim + 1) for _ in range(iLenPlus)] +    dp1[0][0] = 1 +    dp1[0][aPlus[0]] = 1 +    for j in range(1, iLenPlus): +        for k in range(iUlim + 1): +            if k < aPlus[j]: +                dp1[j][k] = dp1[j - 1][k] -                dp[j][k][s] = 0 -iRet = 0 -for k in range(1, iN + 1): -    iRet += dp[iN][k][k * iA] +                dp1[j][k] = dp1[j - 1][k] + dp1[j - 1][k - aPlus[j]] +    dp2 = [[0] * (iOlim + 1) for _ in range(iLenMinus)] +    dp2[0][0] = 1 +    dp2[0][aMinus[0]] = 1 +    for j in range(1, iLenMinus): +        for k in range(iUlim + 1): +            if k < aMinus[j]: +                dp2[j][k] = dp2[j - 1][k] +            else: +                dp2[j][k] = dp2[j - 1][k] + dp2[j - 1][k - aMinus[j]] +    for i in range(1, iUlim + 1): +        iRet += iCZero * dp1[-1][i] * dp2[-1][i]