n,a=list(map(int,input().split()))

l=[int(i) for i in input().split()]

ans=0

#dp=[[[0 for i in range(51)] for j in range(51)] for k in range(2501)]

dp=[[[0 for i in range(2501)] for j in range(51)] for k in range(51)]

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



for i in range(n):

    for j in range(50):

        for k in range(2501):

            if dp[i][j][k]:

                dp[i+1][j][k]+=dp[i][j][k]

                dp[i+1][j+1][k+l[i]]+=dp[i][j][k]

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

    ans+=dp[n][i][i*a]

print(ans)
def sol():

    n,a=list(map(int,input().split()))

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

    ans=chk=0

    d=[[0]*2501 for j in range(51)]

    d[0][0]=1

    for i in x:

        for j in range(2500,i-1,-1):

            for k in range(50,0,-1):

                d[k][j]+=d[k-1][j-i]

    for i in range(1,51):

        ans+=d[i][i*a]

    print(ans)



if __name__=="__main__":

    sol()

n, a = list(map(int, input().split()))
l = [int(i) for i in input().split()]
ans = 0
# dp=[[[0 for i in range(51)] for j in range(51)] for k in range(2501)]
dp = [[[0 for i in range(2501)] for j in range(51)] for k in range(51)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(50):
        for k in range(2501):
            if dp[i][j][k]:
                dp[i + 1][j][k] += dp[i][j][k]
                dp[i + 1][j + 1][k + l[i]] += dp[i][j][k]
for i in range(1, n + 1):
    ans += dp[n][i][i * a]
print(ans)

def sol():
    n, a = list(map(int, input().split()))
    x = [int(i) for i in input().split()]
    ans = chk = 0
    d = [[0] * 2501 for j in range(51)]
    d[0][0] = 1
    for i in x:
        for j in range(2500, i - 1, -1):
            for k in range(50, 0, -1):
                d[k][j] += d[k - 1][j - i]
    for i in range(1, 51):
        ans += d[i][i * a]
    print(ans)


if __name__ == "__main__":
    sol()

-n, a = list(map(int, input().split())) -l = [int(i) for i in input().split()] -ans = 0 -# dp=[[[0 for i in range(51)] for j in range(51)] for k in range(2501)] -dp = [[[0 for i in range(2501)] for j in range(51)] for k in range(51)] -dp[0][0][0] = 1 -for i in range(n): -    for j in range(50): -        for k in range(2501): -            if dp[i][j][k]: -                dp[i + 1][j][k] += dp[i][j][k] -                dp[i + 1][j + 1][k + l[i]] += dp[i][j][k] -for i in range(1, n + 1): -    ans += dp[n][i][i * a] -print(ans) +def sol(): +    n, a = list(map(int, input().split())) +    x = [int(i) for i in input().split()] +    ans = chk = 0 +    d = [[0] * 2501 for j in range(51)] +    d[0][0] = 1 +    for i in x: +        for j in range(2500, i - 1, -1): +            for k in range(50, 0, -1): +                d[k][j] += d[k - 1][j - i] +    for i in range(1, 51): +        ans += d[i][i * a] +    print(ans) + + +if __name__ == "__main__": +    sol()