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

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

x=max(l)

x=max(x,a)

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



for j in range(n+1):

  for k in range(n+1):

    for s in range(n*x+1):

      if j==0 and k==0 and s==0:

        dp[j][k][s]=1

      elif j>=1 and s<l[j-1]:

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

      elif j>=1 and k>=1 and s>=l[j-1]:

        dp[j][k][s]=dp[j-1][k][s]+dp[j-1][k-1][s-l[j-1]]

      else:

        dp[j][k][s]=0



s=0

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

  s+=dp[n][k][k*a]



print(s)
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]]

            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()))
l = list(map(int, input().split()))
x = max(l)
x = max(x, a)
dp = [[[0 for _ in range(n * x + 1)] for _ in range(n + 1)] for _ in range(n + 1)]
for j in range(n + 1):
    for k in range(n + 1):
        for s in range(n * x + 1):
            if j == 0 and k == 0 and s == 0:
                dp[j][k][s] = 1
            elif j >= 1 and s < l[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s]
            elif j >= 1 and k >= 1 and s >= l[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - l[j - 1]]
            else:
                dp[j][k][s] = 0
s = 0
for k in range(1, n + 1):
    s += dp[n][k][k * a]
print(s)

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]]
            else:
                dp[i][j][k] = 0
print((sum(dp[n][i][i * a] for i in range(1, n + 1))))

-l = list(map(int, input().split())) -x = max(l) -x = max(x, a) -dp = [[[0 for _ in range(n * x + 1)] for _ in range(n + 1)] for _ in range(n + 1)] -for j in range(n + 1): -    for k in range(n + 1): -        for s in range(n * x + 1): -            if j == 0 and k == 0 and s == 0: -                dp[j][k][s] = 1 -            elif j >= 1 and s < l[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] -            elif j >= 1 and k >= 1 and s >= l[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - l[j - 1]] +(*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]] -                dp[j][k][s] = 0 -s = 0 -for k in range(1, n + 1): -    s += dp[n][k][k * a] -print(s) +                dp[i][j][k] = 0 +print((sum(dp[n][i][i * a] for i in range(1, n + 1))))