import itertools
from collections import defaultdict

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

dp = [[defaultdict(lambda: 0) for j in range(50*N+1)] for i in range(N+1)]
dp[0][0][0] = 1

for i in range(N):
    for j in range(50*N+1):
        for k, v in dp[i][j].items():
            dp[i+1][j][k] += v
        if j >= X[i]:
            for k, v in dp[i][j-X[i]].items():
                dp[i+1][j][k+1] += v

ans = 0
for j in range(1, N+1):
    ans += dp[N][j*A][j] 

print(ans)