

#人のすなるCounterなるものを我も書いてみんとてするなり

from collections import Counter



#方針 マイナスとプラスでDPを分割

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

#0の場合はnCkの累積和なので別に計算する

#知ってたわけではなく解析しててみつけた

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 = Counter([0,aPlus[0]])

    for i in range(1,iLenPlus):

        iThisX = aPlus[i]

        tmp = {}

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

            tmp[iThisX + k] = v

        dp1 += tmp

    dp2 = Counter([0,aMinus[0]])

    for i in range(1,iLenMinus):

        iThisX = aMinus[i]

        tmp = {}

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

            tmp[iThisX + k] = v

        dp2 += tmp

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

        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)

解()

# 人のすなるCounterなるものを我も書いてみんとてするなり
from collections import Counter

# 方針 マイナスとプラスでDPを分割
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
# 0の場合はnCkの累積和なので別に計算する
# 知ってたわけではなく解析しててみつけた
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 = Counter([0, aPlus[0]])
    for i in range(1, iLenPlus):
        iThisX = aPlus[i]
        tmp = {}
        for k, v in list(dp1.items()):
            tmp[iThisX + k] = v
        dp1 += tmp
    dp2 = Counter([0, aMinus[0]])
    for i in range(1, iLenMinus):
        iThisX = aMinus[i]
        tmp = {}
        for k, v in list(dp2.items()):
            tmp[iThisX + k] = v
        dp2 += tmp
    for i in range(1, iUlim + 1):
        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)


解()

-# 人のすなるCounterなるものを我も書いてみんとてするなり -from collections import Counter +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を分割 -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 -# 0の場合はnCkの累積和なので別に計算する -# 知ってたわけではなく解析しててみつけた -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 = Counter([0, aPlus[0]]) -    for i in range(1, iLenPlus): -        iThisX = aPlus[i] -        tmp = {} -        for k, v in list(dp1.items()): -            tmp[iThisX + k] = v -        dp1 += tmp -    dp2 = Counter([0, aMinus[0]]) -    for i in range(1, iLenMinus): -        iThisX = aMinus[i] -        tmp = {} -        for k, v in list(dp2.items()): -            tmp[iThisX + k] = v -        dp2 += tmp -    for i in range(1, iUlim + 1): -        iRet += iCZero * dp1[i] * dp2[i] -print(iRet) + +解()