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

dp = [[[0 for _ in range(2555)] for _ in range(55)] for _ in range(55)]
dp[0][0][0]=1
for j in range(n):
    for k in range(n):
        for s in range(a*n+1):
            dp[j+1][k][s] += dp[j][k][s]
            dp[j+1][k+1][s+x[j]] += dp[j][k][s]

ans=0
for k in range(1,n+1):
    ans+=dp[n][k][a*k]
print(ans)