# coding: utf-8
n, a = map(int, input().split())
l_a = list(map(lambda x: int(x) - a, input().split()))

dic = dict()
dic[0] = 1
for x in l_a:
    for key, value in list(dic.items()):
        dic[x + key] = value + dic.get(x+key,0)

print(dic[0] - 1)
