from collections import defaultdict

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

x = [x - A for x in x]

counter = defaultdict(int)
counter[0] = 1

for x_i in x:
    copy = dict(counter)
    for d, c in copy.items():
        counter[d+x_i] += c

print(counter[0]-1)
