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

dp = [[[0]*(n*a+1) for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(i+1):
        for s in range(n*a + 1):
            dp[i+1][j][s] += dp[i][j][s]
            if s + x[i] <= n*a:
                dp[i+1][j+1][s+x[i]] += dp[i][j][s]
ans = 0
for j in range(1,n+1):
    ans += dp[n][j][j*a]
print(ans)
