N,A = 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 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)