from collections import defaultdict
def solve():
	N,A = map(int,raw_input().split())
	x = map(int,raw_input().split())
	DP = [defaultdict(int) for i in xrange(N+1)]
	DP[0][0] = 1
	for i in xrange(N):
		for k,v in DP[i].iteritems():
			DP[i+1][k+x[i]-A] += v
			DP[i+1][k] += v
	print DP[N][0] - 1
solve()