from collections import defaultdict

N, A = map(int, input().split())
intA = lambda x: int(x) - A
X = tuple(map(intA, input().split()))

d = defaultdict(int)
for x in X:
    new_d = d.copy()
    for k, v in d.items():
        new_d[k + x] += v
    new_d[x + 2500] += 1
    d = new_d
print(d[2500])
