t=input()
while t>=1:
	n,p=map(int,raw_input().split())
	l=map(int,raw_input().split())
	count =0
	if p in l:
		for i in l:
			if i>p:
				count+=1
		print "YES",
		print count
	else:
		print "NO",
		print 0
	t-=1