# coding: utf-8
from collections import defaultdict

num_card, num_ave = map(int, input().split())
l_card = map(lambda x: int(x) - num_ave, input().split())

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

for card in l_card:
    for d, c in list(counter.items()):
        counter[d + card] += c

print(counter[0] - 1)