test_cases=int(raw_input())
for i in range(test_cases):
	member,power=raw_input().split()
	member=int(member)
	power=int(power)
	a=[0]*member
	a=raw_input().split()
	for i in range(len(a)):
		a[i]=int(a[i])
	if power in a:
		count=0
		for i in range(len(a)):
			if power<a[i]:
				count+=1
		print "YES"+" "+str(count)
	else:
		print "NO"+" "+str(0)