from itertools import combinations
N, A = map(int, input().split())
X = list(map(int, input().split()))

if N >= 17:
    exit()

ans = 0
for i in range(1, N + 1):
    combs = combinations(range(N), i)
    for comb in combs:
        temp = sum([X[c] for c in comb])
        if temp == A * i:
            ans += 1
print(ans)
