def solve():
	N,A = map(int,raw_input().split())
	x = map(int,raw_input().split())
	ofs = N*50; M = ofs*2 + 1
	DP = [[0]*M for i in xrange(N+1)]
	DP[0][ofs] = 1
	for i in xrange(N):
		for j in xrange(M):
			if DP[i][j] == 0: continue
			DP[i+1][j+x[i]-A] += DP[i][j]
			DP[i+1][j] += DP[i][j]
	print DP[N][ofs] - 1
solve()