from collections import Counter

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

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



dp = [Counter() for i in range(N+1)]

dp[0][0] = 1



for i,x in enumerate(X):

    for j in range(i,-1,-1):

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

            dp[j+1][k+x] += v



ans = 0

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

    ans += dp[i][A*i]

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

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



from collections import defaultdict

dp = [defaultdict(lambda: 0) for _ in range(N+1)]

dp[0][0] = 1

for i,x in enumerate(X):

    for j in range(i,-1,-1):

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

            dp[j+1][k+x] += v



ans = 0

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

    ans += dp[i][i*A]

print(ans)
from collections import Counter

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
dp = [Counter() for i in range(N + 1)]
dp[0][0] = 1
for i, x in enumerate(X):
    for j in range(i, -1, -1):
        for k, v in list(dp[j].items()):
            dp[j + 1][k + x] += v
ans = 0
for i in range(1, N + 1):
    ans += dp[i][A * i]
print(ans)

N, A = list(map(int, input().split()))
X = list(map(int, input().split()))
from collections import defaultdict

dp = [defaultdict(lambda: 0) for _ in range(N + 1)]
dp[0][0] = 1
for i, x in enumerate(X):
    for j in range(i, -1, -1):
        for k, v in list(dp[j].items()):
            dp[j + 1][k + x] += v
ans = 0
for i in range(1, N + 1):
    ans += dp[i][i * A]
print(ans)

-from collections import Counter - -dp = [Counter() for i in range(N + 1)] +from collections import defaultdict + +dp = [defaultdict(lambda: 0) for _ in range(N + 1)] -    ans += dp[i][A * i] +    ans += dp[i][i * A]