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)
    for j in p:
        if K == (sum(j)/(i+1)):
            count += 1
print(count)