def solve():

  ans = 0

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

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

  x = sum(X)

  dp = [[[0]*2550 for _ in range(N+1)] for _ in range(N+1)]

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

  for i in range(N):

    for j in range(i+1):

      for k in range(x):

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

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

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

    ans += dp[-1][j][j*A]

  return ans

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

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

dp = [0]*10000

dp[0] = 1

for i in range(N):

  new_dp = dp[:]

  for j in range(-3000,3000):

    if dp[j]>0:

      new_dp[j+X[i]] += dp[j]

  dp = new_dp

print((dp[0]-1))

def solve():
    ans = 0
    N, A = list(map(int, input().split()))
    X = list(map(int, input().split()))
    x = sum(X)
    dp = [[[0] * 2550 for _ in range(N + 1)] for _ in range(N + 1)]
    dp[0][0][0] = 1
    for i in range(N):
        for j in range(i + 1):
            for k in range(x):
                dp[i + 1][j][k] += dp[i][j][k]
                dp[i + 1][j + 1][k + X[i]] += dp[i][j][k]
    for j in range(1, N + 1):
        ans += dp[-1][j][j * A]
    return ans


print((solve()))

N, A = list(map(int, input().split()))
X = list([int(x) - A for x in input().split()])
dp = [0] * 10000
dp[0] = 1
for i in range(N):
    new_dp = dp[:]
    for j in range(-3000, 3000):
        if dp[j] > 0:
            new_dp[j + X[i]] += dp[j]
    dp = new_dp
print((dp[0] - 1))

-def solve(): -    ans = 0 -    N, A = list(map(int, input().split())) -    X = list(map(int, input().split())) -    x = sum(X) -    dp = [[[0] * 2550 for _ in range(N + 1)] for _ in range(N + 1)] -    dp[0][0][0] = 1 -    for i in range(N): -        for j in range(i + 1): -            for k in range(x): -                dp[i + 1][j][k] += dp[i][j][k] -                dp[i + 1][j + 1][k + X[i]] += dp[i][j][k] -    for j in range(1, N + 1): -        ans += dp[-1][j][j * A] -    return ans - - -print((solve())) +N, A = list(map(int, input().split())) +X = list([int(x) - A for x in input().split()]) +dp = [0] * 10000 +dp[0] = 1 +for i in range(N): +    new_dp = dp[:] +    for j in range(-3000, 3000): +        if dp[j] > 0: +            new_dp[j + X[i]] += dp[j] +    dp = new_dp +print((dp[0] - 1))