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

x=list([int(x)-a for x in input().split()])

m=0 if min(x)>0 else min(x)*n

M=1 if max(x)<0 else max(x)*n+1

dp=[[0]*(M-m) for _ in range(n)]

dp[0][x[0]]+=1

dp[0][0]+=1

for i in range(n-1):

    for j in range(m,M):

        if j+x[i+1] in range(m,M):dp[i+1][j+x[i+1]]+=dp[i][j]

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

print((dp[n-1][0]-1))
n,a=list(map(int,input().split()))

x=list([int(x)-a for x in input().split()])

m=min(0,min(x)*n)

M=max(0,max(x)*n)

dp=[1]+[0]*(M-m)

dp[x[0]]+=1

for i in range(n-1):

    l=list(range(m-x[i+1],M+1)) if x[i+1]<0 else list(range(M-x[i+1],m-1,-1))

    for j in l:dp[j+x[i+1]]+=dp[j]

print((dp[0]-1))
n, a = list(map(int, input().split()))
x = list([int(x) - a for x in input().split()])
m = 0 if min(x) > 0 else min(x) * n
M = 1 if max(x) < 0 else max(x) * n + 1
dp = [[0] * (M - m) for _ in range(n)]
dp[0][x[0]] += 1
dp[0][0] += 1
for i in range(n - 1):
    for j in range(m, M):
        if j + x[i + 1] in range(m, M):
            dp[i + 1][j + x[i + 1]] += dp[i][j]
        dp[i + 1][j] += dp[i][j]
print((dp[n - 1][0] - 1))

n, a = list(map(int, input().split()))
x = list([int(x) - a for x in input().split()])
m = min(0, min(x) * n)
M = max(0, max(x) * n)
dp = [1] + [0] * (M - m)
dp[x[0]] += 1
for i in range(n - 1):
    l = (
        list(range(m - x[i + 1], M + 1))
        if x[i + 1] < 0
        else list(range(M - x[i + 1], m - 1, -1))
    )
    for j in l:
        dp[j + x[i + 1]] += dp[j]
print((dp[0] - 1))

-m = 0 if min(x) > 0 else min(x) * n -M = 1 if max(x) < 0 else max(x) * n + 1 -dp = [[0] * (M - m) for _ in range(n)] -dp[0][x[0]] += 1 -dp[0][0] += 1 +m = min(0, min(x) * n) +M = max(0, max(x) * n) +dp = [1] + [0] * (M - m) +dp[x[0]] += 1 -    for j in range(m, M): -        if j + x[i + 1] in range(m, M): -            dp[i + 1][j + x[i + 1]] += dp[i][j] -        dp[i + 1][j] += dp[i][j] -print((dp[n - 1][0] - 1)) +    l = ( +        list(range(m - x[i + 1], M + 1)) +        if x[i + 1] < 0 +        else list(range(M - x[i + 1], m - 1, -1)) +    ) +    for j in l: +        dp[j + x[i + 1]] += dp[j] +print((dp[0] - 1))