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

# import numpy as np
# dp = np.full((n + 1, n + 1, n * max(x + [a]) + 1), None).tolist()
#
def full(shape, value):
    if not shape:
        return value
    return [full(shape[1:], value) for _ in range(shape[0])]
dp = full((n + 1, n + 1, n * max(x + [a]) + 1), None)

def dfs(j=n, k=n, s=n * max(x)):
    if dp[j][k][s] is not None:
        return dp[j][k][s]
    if j == k == s == 0:
        dp[0][0][0] = 1
        return 1
    result = 0
    if j >= 1:
        if x[j - 1] > s:
            result = dfs(j - 1, k, s)
        elif k >= 1:
            result = dfs(j - 1, k, s) + dfs(j - 1, k - 1, s - x[j - 1])
    dp[j][k][s] = result
    return result

print(sum(dfs(n, k, k * a) for k in range(1, n + 1)))
