import itertools

N, A = map(int, raw_input().split())
x_n = map(int, raw_input().split())

ans_list = []
for i in xrange(1, len(x_n)+1):
    for x in itertools.combinations(x_n, i):
        if sum(x) / len(x) == A and sum(x) % len(x) == 0:
            ans_list.append(x)

print len(ans_list)
