import sys
t=input()
for i in range(t):
	n,sam=map(int,raw_input().split())

	count=0
	n1=[int(x) for x in raw_input().split()]
	if sam not in n1:
		print "NO 0"
	else:
		for j in n1:
			if j>sam:
				count+=1
		print "YES "+str(count)