N, A = [int(x) for x in input().split()]
X = [int(x) for x in input().split()]

from functools import lru_cache

@lru_cache(maxsize=1000000000)
def f(j, k, s):
    if j == 0 and k == 0 and s == 0:
        return 1
    elif j > 0 and X[j - 1] > s:
        return f(j - 1, k, s)
    elif j > 0 and k - 1 >= 0 and s - X[j - 1] >= 0:
        return f(j - 1, k, s) + f(j - 1, k - 1, s - X[j - 1])
    else:
        return 0


ret = 0
for i in range(N + 1):
    r = f(N, i + 1, (i + 1) * A)
    ret += r

print(ret)