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

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



X = max(x)

if X < A:

    X = A



def check(j, k, s):

    if dp[j][k][s] != -1:

        return dp[j][k][s]

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

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

        return 1

    if j >= 1 and s < x[j-1]:

        a = check(j-1, k ,s)

        dp[j][k][s] = a

        return a

    if j >= 1 and k >= 1 and s >= x[j-1]:

        a = check(j-1, k, s) + check(j-1, k-1, s-x[j-1])

        dp[j][k][s] = a

        return a

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

    return 0

        

dp = [[[-1] * (N*X+1) for _ in range(N+1)] for _ in range(N + 1)]

# dp = np.array(dp)

# print (dp)

# for j in range(N+1):

#     for k in range(N+1):

#         for s in range(N*X + 1):

#             print (j, k, s)

#             dp[j][k][s] = check(j, k, s)



ans = 0

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

    ans += check(N, k, k * A)

    # ans += dp[N][k][k * A]



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

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



X = max(x)

if X < A:

    X = A

    

y = []

for i in x:

    y += [i-A]



dp = [[-1] * (2*N*X+1) for _ in range(N+1)]



def check(j, t):

    if dp[j][t] != -1:

        return dp[j][t]

    if  j == 0 and t == N * X:

        dp[j][t] = 1

        return 1

    if j >= 1 and (t-y[j-1] < 0 or t-y[j-1] > 2 * N * X):

        dp[j][t] = check(j-1, t)

        return dp[j][t]

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

        dp[j][t] = check(j-1, t) + check(j-1, t- y[j-1])

        return dp[j][t]

    dp[j][t] = 0

    return 0



print((check(N, N*X)-1))

N, A = list(map(int, input().split()))
x = list(map(int, input().split()))
X = max(x)
if X < A:
    X = A


def check(j, k, s):
    if dp[j][k][s] != -1:
        return dp[j][k][s]
    if j == 0 and k == 0 and s == 0:
        dp[j][k][s] = 1
        return 1
    if j >= 1 and s < x[j - 1]:
        a = check(j - 1, k, s)
        dp[j][k][s] = a
        return a
    if j >= 1 and k >= 1 and s >= x[j - 1]:
        a = check(j - 1, k, s) + check(j - 1, k - 1, s - x[j - 1])
        dp[j][k][s] = a
        return a
    dp[j][k][s] = 0
    return 0


dp = [[[-1] * (N * X + 1) for _ in range(N + 1)] for _ in range(N + 1)]
# dp = np.array(dp)
# print (dp)
# for j in range(N+1):
#     for k in range(N+1):
#         for s in range(N*X + 1):
#             print (j, k, s)
#             dp[j][k][s] = check(j, k, s)
ans = 0
for k in range(1, N + 1):
    ans += check(N, k, k * A)
    # ans += dp[N][k][k * A]
print(ans)

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


def check(j, t):
    if dp[j][t] != -1:
        return dp[j][t]
    if j == 0 and t == N * X:
        dp[j][t] = 1
        return 1
    if j >= 1 and (t - y[j - 1] < 0 or t - y[j - 1] > 2 * N * X):
        dp[j][t] = check(j - 1, t)
        return dp[j][t]
    if j >= 1 and 0 <= t - y[j - 1] and t - y[j - 1] <= 2 * N * X:
        dp[j][t] = check(j - 1, t) + check(j - 1, t - y[j - 1])
        return dp[j][t]
    dp[j][t] = 0
    return 0


print((check(N, N * X) - 1))

+y = [] +for i in x: +    y += [i - A] +dp = [[-1] * (2 * N * X + 1) for _ in range(N + 1)] -def check(j, k, s): -    if dp[j][k][s] != -1: -        return dp[j][k][s] -    if j == 0 and k == 0 and s == 0: -        dp[j][k][s] = 1 +def check(j, t): +    if dp[j][t] != -1: +        return dp[j][t] +    if j == 0 and t == N * X: +        dp[j][t] = 1 -    if j >= 1 and s < x[j - 1]: -        a = check(j - 1, k, s) -        dp[j][k][s] = a -        return a -    if j >= 1 and k >= 1 and s >= x[j - 1]: -        a = check(j - 1, k, s) + check(j - 1, k - 1, s - x[j - 1]) -        dp[j][k][s] = a -        return a -    dp[j][k][s] = 0 +    if j >= 1 and (t - y[j - 1] < 0 or t - y[j - 1] > 2 * N * X): +        dp[j][t] = check(j - 1, t) +        return dp[j][t] +    if j >= 1 and 0 <= t - y[j - 1] and t - y[j - 1] <= 2 * N * X: +        dp[j][t] = check(j - 1, t) + check(j - 1, t - y[j - 1]) +        return dp[j][t] +    dp[j][t] = 0 -dp = [[[-1] * (N * X + 1) for _ in range(N + 1)] for _ in range(N + 1)] -# dp = np.array(dp) -# print (dp) -# for j in range(N+1): -#     for k in range(N+1): -#         for s in range(N*X + 1): -#             print (j, k, s) -#             dp[j][k][s] = check(j, k, s) -ans = 0 -for k in range(1, N + 1): -    ans += check(N, k, k * A) -    # ans += dp[N][k][k * A] -print(ans) +print((check(N, N * X) - 1))