from collections import Counter
N,A = 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 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)