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

dp = [Zeros(3000,n+1) for k in range(n+1)]

dp[0][0][0] = 1
for i in range(n):
    for j in range(2900):
        for k in range(n):
            dp[i+1][j+a[i]][k+1] += dp[i][j][k]
            dp[i+1][j][k] += dp[i][j][k]

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