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

max_x = max(x)
dp = [[0 for _  in range(n * 2 * max_x + 1)] for _ in range(n + 1)]

dp[0][n * max_x] = 1
for i in range(1, n + 1):
    for j in range(1, n * 2 * max_x + 1):
        if 0 <= j + a - x[i - 1] <= 2 * n * max_x:
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j + a - x[i - 1]]
        else:
            dp[i][j] = dp[i - 1][j]

print(dp[n][n * max_x] - 1)