import numpy as np

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

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

dp = np.zeros((N+1,3000),dtype=np.int64) # 枚数、目標数ごとに場合の数

dp[0,0] = 1



for x in X:

  dp[1:,x:] += dp[:-1,:-x].copy()

  

answer = 0

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

  answer += dp[n,n*A]

  

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

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

dp = {0:1}



for y in Y:

	for k,v in list(dp.items()):

		dp[k+y]=dp.get(k+y,0)+v



print((dp[0]-1))
import numpy as np

N, A = list(map(int, input().split()))
X = [int(x) for x in input().split()]
dp = np.zeros((N + 1, 3000), dtype=np.int64)  # 枚数、目標数ごとに場合の数
dp[0, 0] = 1
for x in X:
    dp[1:, x:] += dp[:-1, :-x].copy()
answer = 0
for n in range(1, N + 1):
    answer += dp[n, n * A]
print(answer)

N, A = list(map(int, input().split()))
Y = list([int(x) - A for x in input().split()])
dp = {0: 1}
for y in Y:
    for k, v in list(dp.items()):
        dp[k + y] = dp.get(k + y, 0) + v
print((dp[0] - 1))

-import numpy as np - -X = [int(x) for x in input().split()] -dp = np.zeros((N + 1, 3000), dtype=np.int64)  # 枚数、目標数ごとに場合の数 -dp[0, 0] = 1 -for x in X: -    dp[1:, x:] += dp[:-1, :-x].copy() -answer = 0 -for n in range(1, N + 1): -    answer += dp[n, n * A] -print(answer) +Y = list([int(x) - A for x in input().split()]) +dp = {0: 1} +for y in Y: +    for k, v in list(dp.items()): +        dp[k + y] = dp.get(k + y, 0) + v +print((dp[0] - 1))