from itertools import combinations
n,a = map(int , raw_input().split())
har = map(int , raw_input().split())
ans = 0
for i in xrange(1,n+1):
    for ix in combinations(har,i):
        if sum(list(ix))/float(i) == a:
            ans += 1
print ans
