def 解():

    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



    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)

解()

#正負で分割

#dpの作り方はARCの方の人のロジックを参考にした。

#こんなんでええんや...

def 解():

    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



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



    iRet = 0

    iRet += iCZero

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



    iUlim = min(sum(aPlus) , sum(aMinus))

    if 0 < iUlim:

        dp1 = {0:1}

        for iX in aPlus:

            for k,v in list(dp1.copy().items()):

                dp1[k+iX] = dp1.get(k+iX,0)+v

        dp2 = {0:1}

        for iX in aMinus:

            for k,v in list(dp2.copy().items()):

                dp2[k+iX] = dp2.get(k+iX,0)+v

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

            if i in dp1 and i in dp2:

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

    print(iRet)

解()

def 解():
    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
    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)


解()

# 正負で分割
# dpの作り方はARCの方の人のロジックを参考にした。
# こんなんでええんや...
def 解():
    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
    iCZero = 2**iLen0 - 1  # sum(k=1..N){nCk} = 2^n -1
    iRet = 0
    iRet += iCZero
    iCZero += 1  # 0の場合を追加
    iUlim = min(sum(aPlus), sum(aMinus))
    if 0 < iUlim:
        dp1 = {0: 1}
        for iX in aPlus:
            for k, v in list(dp1.copy().items()):
                dp1[k + iX] = dp1.get(k + iX, 0) + v
        dp2 = {0: 1}
        for iX in aMinus:
            for k, v in list(dp2.copy().items()):
                dp2[k + iX] = dp2.get(k + iX, 0) + v
        for i in range(1, iUlim + 1):
            if i in dp1 and i in dp2:
                iRet += iCZero * dp1[i] * dp2[i]
    print(iRet)


解()

+# 正負で分割 +# dpの作り方はARCの方の人のロジックを参考にした。 +# こんなんでええんや... -    iSumPlus = sum(aPlus) -    iSumMinus = sum(aMinus) -    iUlim = min(iSumPlus, iSumMinus) -    iOlim = max(iSumPlus, iSumMinus) +    iUlim = min(sum(aPlus), sum(aMinus)) -        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]] +        dp1 = {0: 1} +        for iX in aPlus: +            for k, v in list(dp1.copy().items()): +                dp1[k + iX] = dp1.get(k + iX, 0) + v +        dp2 = {0: 1} +        for iX in aMinus: +            for k, v in list(dp2.copy().items()): +                dp2[k + iX] = dp2.get(k + iX, 0) + v -            iRet += iCZero * dp1[-1][i] * dp2[-1][i] +            if i in dp1 and i in dp2: +                iRet += iCZero * dp1[i] * dp2[i]