t=input()
while t:
	a,b=map(int,raw_input().split())
	l=sorted(map(int,raw_input().split()))
	if b not in l:
		print "NO 0"
	else:
		count=0
		for i in range(0,len(l)):
			if l[i]>b:
				count+=1
		print "YES %d" %(count)
	t-=1