tc=int(raw_input())
while tc:
	n,p=map(int,raw_input().split())
	arr=map(int,raw_input().split())
	flag=0
	gang=0
	for i in range(0,n):
		if flag==0:
			if arr[i]==p:
				flag=1
		if arr[i]>p:
			gang+=1
	if flag==0:
		print "NO",flag
	else:
		print "YES",gang
	tc-=1