times=input()
for _ in range(times):
	in1=raw_input()
	in2=raw_input()
	lst=in1.split()
	num=int(lst[0])
	power=lst[1]
	present='NO'
	more=0
	pow_lst=in2.split()
	if power in pow_lst:
		present='YES'
		for i in pow_lst:
			if int(i)>int(power):
				more+=1
	
	print present,more