import itertools
N, K = list(map(int, input().split()))
x = list(map(int, input().split()))
count = 0

for i in range(N):
    p = itertools.combinations(x,i+1)
    p_ave = [sum(j)/i for j in p]
    count += len(list(filter(lambda n:n==K, p_ave)))
print(count)
