

#正負で分割

#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  #sum(k=1..N){nCk} = 2^n -1 #1は組み合わせ0の場合

    iRet = 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 += dp1[i] * dp2[i]

    print(((iRet+1)*iCZero  -1)) #組み合わせ0の場合を引く

解()

#正負で分割

#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  #sum(k=1..N){nCk} = 2^n -1 #1は組み合わせ0の場合

    iRet = 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()):

                n = k+iX

                if n <= iUlim:

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

        dp2 = {0:1}

        for iX in aMinus:

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

                n = k+iX

                if n <= iUlim:

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

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

            if i in dp1 and i in dp2:

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

    print(((iRet+1)*iCZero  -1)) #組み合わせ0の場合を引く

解()

# 正負で分割
# 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  # sum(k=1..N){nCk} = 2^n -1 #1は組み合わせ0の場合
    iRet = 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 += dp1[i] * dp2[i]
    print(((iRet + 1) * iCZero - 1))  # 組み合わせ0の場合を引く


解()

# 正負で分割
# 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  # sum(k=1..N){nCk} = 2^n -1 #1は組み合わせ0の場合
    iRet = 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()):
                n = k + iX
                if n <= iUlim:
                    dp1[n] = dp1.get(n, 0) + v
        dp2 = {0: 1}
        for iX in aMinus:
            for k, v in list(dp2.copy().items()):
                n = k + iX
                if n <= iUlim:
                    dp2[n] = dp2.get(n, 0) + v
        for i in range(1, iUlim + 1):
            if i in dp1 and i in dp2:
                iRet += dp1[i] * dp2[i]
    print(((iRet + 1) * iCZero - 1))  # 組み合わせ0の場合を引く


解()

-# こんなんでええんや... -                dp1[k + iX] = dp1.get(k + iX, 0) + v +                n = k + iX +                if n <= iUlim: +                    dp1[n] = dp1.get(n, 0) + v -                dp2[k + iX] = dp2.get(k + iX, 0) + v +                n = k + iX +                if n <= iUlim: +                    dp2[n] = dp2.get(n, 0) + v