import sys

input=sys.stdin.readline

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

x=[0]+list(map(int,input().split()))

su=sum(x)

maxi=max(x)

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

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

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

    for j in range(i+1):

        for k in range(maxi*j+1):

            if k<x[i]:

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

            if k>=x[i] and j>=1:

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

ans=0

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

    if a*t<=su:

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

    else:

        break

print(ans)

from collections import Counter

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

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

ans=Counter([0])

for x in X:

    tmp=Counter()

    for i,j in list(ans.items()):

        tmp[i+x]+=j

    ans+=tmp

print((ans[0]-1))



import sys

input = sys.stdin.readline
n, a = list(map(int, input().split()))
x = [0] + list(map(int, input().split()))
su = sum(x)
maxi = max(x)
dp = [[[0 for k in range(maxi * n + 1)] for j in range(51)] for i in range(51)]
dp[0][0][0] = 1
for i in range(1, n + 1):
    for j in range(i + 1):
        for k in range(maxi * j + 1):
            if k < x[i]:
                dp[i][j][k] = dp[i - 1][j][k]
            if k >= x[i] and j >= 1:
                dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]]
ans = 0
for t in range(1, n + 1):
    if a * t <= su:
        ans += dp[n][t][a * t]
    else:
        break
print(ans)

from collections import Counter

n, a = list(map(int, input().split()))
X = sorted(list([int(x) - a for x in input().split()]))
ans = Counter([0])
for x in X:
    tmp = Counter()
    for i, j in list(ans.items()):
        tmp[i + x] += j
    ans += tmp
print((ans[0] - 1))

-import sys +from collections import Counter -input = sys.stdin.readline -x = [0] + list(map(int, input().split())) -su = sum(x) -maxi = max(x) -dp = [[[0 for k in range(maxi * n + 1)] for j in range(51)] for i in range(51)] -dp[0][0][0] = 1 -for i in range(1, n + 1): -    for j in range(i + 1): -        for k in range(maxi * j + 1): -            if k < x[i]: -                dp[i][j][k] = dp[i - 1][j][k] -            if k >= x[i] and j >= 1: -                dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]] -ans = 0 -for t in range(1, n + 1): -    if a * t <= su: -        ans += dp[n][t][a * t] -    else: -        break -print(ans) +X = sorted(list([int(x) - a for x in input().split()])) +ans = Counter([0]) +for x in X: +    tmp = Counter() +    for i, j in list(ans.items()): +        tmp[i + x] += j +    ans += tmp +print((ans[0] - 1))