n, a = map(int, input().split())
x = [int(i) for i in input().split()]
dp = []
for _ in range(n + 1):
    k = []
    for _ in range(n + 1):
        k.append([0] * ((n * a) + 1))
    dp.append(k)
dp[0][0][0] = 1
for j in range(1, n + 1):
    for k in range(n + 1):
        for s in range((n * a) + 1):
            if (k >= 1):
                if (s >= x[j - 1]):
                    dp[j][k][s] = dp[j - 1][k][s] + dp[j - 1][k - 1][s - x[j - 1]]
                else:
                    dp[j][k][s] = dp[j - 1][k][s]
            elif (s < x[j - 1]):
                dp[j][k][s] = dp[j - 1][k][s]
ans = sum([dp[n][i+1][(i+1)*a] for i in range(n)])
print(ans)