def makelist(n,m,p):

    return [[[0 for k in range(p)]for i in range(m)]for j in range(n)]



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

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

X = max(x)

X = max(X,a)



dp = makelist(n+1,n+1,n*X+1)

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

for j in range(n+1):

    for k in range(n+1):

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

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

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

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

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

ans = 0

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

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

print(ans)
def makelist2(n,m):

    return[[0 for k in range(m)]for i in range(n)]



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

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

X = max(x)

X = max(X,a)

b=[]

for i in range(n):

    b.append(x[i]-a)





dp =makelist2(n+1,2*n*X+1)

dp[0][n*X] = 1

for j in range(n+1):

    for t in range(2*n*X+1):

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

            dp[j][t] = dp[j-1][t]

        elif j>= 1:

            dp[j][t] = dp[j-1][t] + dp[j-1][t-b[j-1]]

print((dp[n][n*X]-1))
def makelist(n, m, p):
    return [[[0 for k in range(p)] for i in range(m)] for j in range(n)]


n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
X = max(x)
X = max(X, a)
dp = makelist(n + 1, n + 1, n * X + 1)
dp[0][0][0] = 1
for j in range(n + 1):
    for k in range(n + 1):
        for s in range(n * X + 1):
            if j * k > 0 and s >= x[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]]
            elif j >= 1 and s < x[j - 1]:
                dp[j][k][s] = dp[j - 1][k][s]
ans = 0
for k in range(1, n + 1):
    ans += dp[n][k][k * a]
print(ans)

def makelist2(n, m):
    return [[0 for k in range(m)] for i in range(n)]


n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
X = max(x)
X = max(X, a)
b = []
for i in range(n):
    b.append(x[i] - a)
dp = makelist2(n + 1, 2 * n * X + 1)
dp[0][n * X] = 1
for j in range(n + 1):
    for t in range(2 * n * X + 1):
        if j >= 1 and (t - b[j - 1] < 0 or t - b[j - 1] > 2 * n * X):
            dp[j][t] = dp[j - 1][t]
        elif j >= 1:
            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - b[j - 1]]
print((dp[n][n * X] - 1))

-def makelist(n, m, p): -    return [[[0 for k in range(p)] for i in range(m)] for j in range(n)] +def makelist2(n, m): +    return [[0 for k in range(m)] for i in range(n)] -dp = makelist(n + 1, n + 1, n * X + 1) -dp[0][0][0] = 1 +b = [] +for i in range(n): +    b.append(x[i] - a) +dp = makelist2(n + 1, 2 * n * X + 1) +dp[0][n * X] = 1 -    for k in range(n + 1): -        for s in range(n * X + 1): -            if j * k > 0 and s >= x[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]] -            elif j >= 1 and s < x[j - 1]: -                dp[j][k][s] = dp[j - 1][k][s] -ans = 0 -for k in range(1, n + 1): -    ans += dp[n][k][k * a] -print(ans) +    for t in range(2 * n * X + 1): +        if j >= 1 and (t - b[j - 1] < 0 or t - b[j - 1] > 2 * n * X): +            dp[j][t] = dp[j - 1][t] +        elif j >= 1: +            dp[j][t] = dp[j - 1][t] + dp[j - 1][t - b[j - 1]] +print((dp[n][n * X] - 1))