import itertools

N,A = map(int, input().split())
x = list(map(int, input().split()))
result = 0
for i in range(1, (len(x)+1 if N == 1 else len(x)) ):
	for j in itertools.combinations(x, i):
		if sum(j)/len(j) == A:
			result += 1
 
print(result)
