N, A = map(int, input().split())
x = list(map(int, input().split()))

dp = [[[0 for _ in range(2501)] for _ in range(N + 1)] for _ in range(N + 1)]

dp[0][0][0] = 1

for i in range(N):
    for a in range(N):
        for p in range(2500 - x[i]):
            dp[i + 1][a + 1][p + x[i]] += dp[i][a][p]
            dp[i + 1][a][p] += dp[i][a][p]


ret = 0
for a in range(1, N+1):
    ret += dp[N][a][A * a]

print(ret)