N,A=list(map(int,input().split()))

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

dp=[[[0 for i in range(50*50+1)] for j in range(N+1) ]for k in range(N+1)]

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

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

  for j in range(N+1):

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

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

      if x[i-1]<= k and j>0: dp[i][j][k]+=dp[i-1][j-1][k-x[i-1]]

ans=0

for j in range(1,N+1):

  ans+=dp[N][j][j*A]

print(ans)
N,A=list(map(int,input().split()))

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

X=max(max(x),A)

y=[x[i]-A for i in range(N)]

dp=[[0 for i in range(2*N*X+1)] for j in range(N+1)]

dp[0][N*X]=1

for j in range(1,N+1):

  for k in range(2*N*X+1):

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

    if 0<= k-y[j-1] and k-y[j-1]<=2*N*X:

      dp[j][k]+=dp[j-1][k-y[j-1]]

print((dp[N][N*X]-1))
N, A = list(map(int, input().split()))
x = list(map(int, input().split()))
dp = [[[0 for i in range(50 * 50 + 1)] for j in range(N + 1)] for k in range(N + 1)]
dp[0][0][0] = 1
for i in range(1, N + 1):
    for j in range(N + 1):
        for k in range(50 * 50 + 1):
            dp[i][j][k] = dp[i - 1][j][k]
            if x[i - 1] <= k and j > 0:
                dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]]
ans = 0
for j in range(1, N + 1):
    ans += dp[N][j][j * A]
print(ans)

N, A = list(map(int, input().split()))
x = list(map(int, input().split()))
X = max(max(x), A)
y = [x[i] - A for i in range(N)]
dp = [[0 for i in range(2 * N * X + 1)] for j in range(N + 1)]
dp[0][N * X] = 1
for j in range(1, N + 1):
    for k in range(2 * N * X + 1):
        dp[j][k] = dp[j - 1][k]
        if 0 <= k - y[j - 1] and k - y[j - 1] <= 2 * N * X:
            dp[j][k] += dp[j - 1][k - y[j - 1]]
print((dp[N][N * X] - 1))

-dp = [[[0 for i in range(50 * 50 + 1)] for j in range(N + 1)] for k in range(N + 1)] -dp[0][0][0] = 1 -for i in range(1, N + 1): -    for j in range(N + 1): -        for k in range(50 * 50 + 1): -            dp[i][j][k] = dp[i - 1][j][k] -            if x[i - 1] <= k and j > 0: -                dp[i][j][k] += dp[i - 1][j - 1][k - x[i - 1]] -ans = 0 +X = max(max(x), A) +y = [x[i] - A for i in range(N)] +dp = [[0 for i in range(2 * N * X + 1)] for j in range(N + 1)] +dp[0][N * X] = 1 -    ans += dp[N][j][j * A] -print(ans) +    for k in range(2 * N * X + 1): +        dp[j][k] = dp[j - 1][k] +        if 0 <= k - y[j - 1] and k - y[j - 1] <= 2 * N * X: +            dp[j][k] += dp[j - 1][k - y[j - 1]] +print((dp[N][N * X] - 1))