t= input()
while t:
	t-=1
	n,s=map(int,raw_input().split())
	a=map(int,raw_input().split())
	#print s
	count=0
	if a.count(s):
		for i in a:
			if s<i:
				#print i
				count+=1
		print "YES",
		print count
		
	else:
		print "NO 0"