import itertools

N, A = map(int, input().split())
x    = list(map(int, input().split()))
ans  = 0

for i in range(1,N+1):
    c = map(sum,itertools.combinations(x,i))
    cnt = list(c).count(i*A)
    ans += cnt
print(ans)
