for _ in xrange (input()):
	d=0
	q=0
	c=[]
	a,b=map(int ,raw_input().split())
	c=map(int ,raw_input().split())
	for i in xrange (len(c)):
		if c[i]==b:
			q=1
		elif c[i]>b:
			d+=1
	if q==1 and d>0:
		print "YES",d
	else:
		print "NO 0"