import bisect
from collections import Counter
from itertools import combinations
from math import factorial
n, a = list(map(int, input().split()))
xs = list(map(lambda x: int(x) - a, input().split()))

xs.sort()
l, r = bisect.bisect_left(xs, 0), bisect.bisect_right(xs, 0)
low, zeros, high = xs[:l], xs[l:r], xs[r:]

factor = 2 ** len(zeros)
lsums = sum((Counter(map(sum, combinations(low, 1 + i))) for i in range(len(low))), Counter())
hsums = sum((Counter(map(sum, combinations(high, 1 + i))) for i in range(len(high))), Counter())

ans = 0
for lsum, cnt in lsums.items():
    ans += cnt * hsums[-lsum]
ans *= factor
if len(zeros):
    ans += (2 ** len(zeros) - 1)

print(ans)