T = raw_input("")
for i in range(int(T)):
	np = raw_input("")
	np = np.split();
	Powerone = np[1]
	powers = raw_input("")
	powers = powers.split()
	if Powerone in powers:
		count = [i for i in powers if int(i) > int(Powerone)]
		print("YES " + str(len(count)))
	else:
		print("NO 0")