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

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

dp = [ [[0]*(n*a+1) for j in range(i+1)] for i in range(n+1) ]

for i in range(n+1):

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

for i in range(n):

  for j in range(i+1):

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

      if X[i] > k:

        if i > j:

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

      else:

        if i > j:

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

        else:

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

ans = 0

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

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

print(ans)
import numpy as np



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

X = np.array(input().split(), dtype=np.int64)

Y = X-a

U = max(X.max(), a) * n

dp = np.zeros(2*U+1, dtype=np.int64)

dp[U] = 1

for i in range(n):

  y = Y[i]

  if y >= 0:

    dp[y:] = dp[y:] + dp[:2*U+1-y]

  else:

    dp[:y] = dp[:y] + dp[-y:]

print((dp[U]-1))
n, a = list(map(int, input().split()))
X = list(map(int, input().split()))
dp = [[[0] * (n * a + 1) for j in range(i + 1)] for i in range(n + 1)]
for i in range(n + 1):
    dp[i][0][0] = 1
for i in range(n):
    for j in range(i + 1):
        for k in range(n * a + 1):
            if X[i] > k:
                if i > j:
                    dp[i + 1][j + 1][k] = dp[i][j + 1][k]
            else:
                if i > j:
                    dp[i + 1][j + 1][k] = dp[i][j + 1][k] + dp[i][j][k - X[i]]
                else:
                    dp[i + 1][j + 1][k] = dp[i][j][k - X[i]]
ans = 0
for i in range(1, n + 1):
    ans += dp[n][i][a * i]
print(ans)

import numpy as np

n, a = list(map(int, input().split()))
X = np.array(input().split(), dtype=np.int64)
Y = X - a
U = max(X.max(), a) * n
dp = np.zeros(2 * U + 1, dtype=np.int64)
dp[U] = 1
for i in range(n):
    y = Y[i]
    if y >= 0:
        dp[y:] = dp[y:] + dp[: 2 * U + 1 - y]
    else:
        dp[:y] = dp[:y] + dp[-y:]
print((dp[U] - 1))

+import numpy as np + -X = list(map(int, input().split())) -dp = [[[0] * (n * a + 1) for j in range(i + 1)] for i in range(n + 1)] -for i in range(n + 1): -    dp[i][0][0] = 1 +X = np.array(input().split(), dtype=np.int64) +Y = X - a +U = max(X.max(), a) * n +dp = np.zeros(2 * U + 1, dtype=np.int64) +dp[U] = 1 -    for j in range(i + 1): -        for k in range(n * a + 1): -            if X[i] > k: -                if i > j: -                    dp[i + 1][j + 1][k] = dp[i][j + 1][k] -            else: -                if i > j: -                    dp[i + 1][j + 1][k] = dp[i][j + 1][k] + dp[i][j][k - X[i]] -                else: -                    dp[i + 1][j + 1][k] = dp[i][j][k - X[i]] -ans = 0 -for i in range(1, n + 1): -    ans += dp[n][i][a * i] -print(ans) +    y = Y[i] +    if y >= 0: +        dp[y:] = dp[y:] + dp[: 2 * U + 1 - y] +    else: +        dp[:y] = dp[:y] + dp[-y:] +print((dp[U] - 1))