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