for _ in range(input()):
	n,p=map(int,raw_input().split())
	arr=map(int,raw_input().split())
	
	count=0
	if p in arr:
		print "YES",
		
		for item in arr:
			if item>p:
				count+=1
		print count
		
	else:
		print "NO 0"