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

*x,=list(map(int,input().split()))

dp=[[[None]*(n*50+1) for i in range(n+1)] for _ in range(n+1)]



for i in range(n+1):

    for j in range(n+1):

        for k in range(n*50+1):

            if i==0 and j==0 and k==0:

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

            elif i and k<x[i-1]:

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

            elif i and j and k>=x[i-1]:

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

            else:

                dp[i][j][k]=0



print((sum(dp[n][i][i*a] for i in range(1,n+1))))
n,a=list(map(int,input().split()))

*x,=list(map(int,input().split()))

dp=[[[0]*(n*50+1) for i in range(n+1)] for _ in range(n+1)]



for i in range(n+1):

    for j in range(n+1):

        for k in range(n*50+1):

            if i==0 and j==0 and k==0:

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

            elif i and k<x[i-1]:

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

            elif i and j and k>=x[i-1]:

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



v=0

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

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

print(v)
n, a = list(map(int, input().split()))
(*x,) = list(map(int, input().split()))
dp = [[[None] * (n * 50 + 1) for i in range(n + 1)] for _ in range(n + 1)]
for i in range(n + 1):
    for j in range(n + 1):
        for k in range(n * 50 + 1):
            if i == 0 and j == 0 and k == 0:
                dp[i][j][k] = 1
            elif i and k < x[i - 1]:
                dp[i][j][k] = dp[i - 1][j][k]
            elif i and j and k >= x[i - 1]:
                dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]]
            else:
                dp[i][j][k] = 0
print((sum(dp[n][i][i * a] for i in range(1, n + 1))))

n, a = list(map(int, input().split()))
(*x,) = list(map(int, input().split()))
dp = [[[0] * (n * 50 + 1) for i in range(n + 1)] for _ in range(n + 1)]
for i in range(n + 1):
    for j in range(n + 1):
        for k in range(n * 50 + 1):
            if i == 0 and j == 0 and k == 0:
                dp[i][j][k] = 1
            elif i and k < x[i - 1]:
                dp[i][j][k] = dp[i - 1][j][k]
            elif i and j and k >= x[i - 1]:
                dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]]
v = 0
for i in range(1, n + 1):
    v += dp[n][i][i * a]
print(v)

-dp = [[[None] * (n * 50 + 1) for i in range(n + 1)] for _ in range(n + 1)] +dp = [[[0] * (n * 50 + 1) for i in range(n + 1)] for _ in range(n + 1)] -            else: -                dp[i][j][k] = 0 -print((sum(dp[n][i][i * a] for i in range(1, n + 1)))) +v = 0 +for i in range(1, n + 1): +    v += dp[n][i][i * a] +print(v)