import sys

for __ in range(input()) :
	gang , sam = map(int,sys.stdin.readline().split())
	meet = list(map(int,sys.stdin.readline().split()))
	yes = False
	if sam in meet :
		yes = True
	count = 0
	for i in meet :
		if i>sam :
			count += 1
	if yes :
		print "YES",count
	else :
		print "NO 0"