# coding: utf-8
num_N, num_A = map(int, input().split())
l_card = list(map(int, input().split()))

l_card_ave = [i - num_A for i in l_card]

dict_ans = dict()
dict_ans[0] = 1
for card in l_card_ave:
    for key, value in list(dict_ans.items()):
        dict_ans[key + card] = dict_ans.get(key + card, 0) + value

print(dict_ans[0] - 1)