for _ in range(input()):
	n,k=map(int,raw_input().split())
	a=map(int,raw_input().split())
	b=[]
	c=0
		
	if k not in a:
		
		print "NO 0"
	else:
		for i in range(n):
			if(a[i]>k):
				c+=1
		print 'YES '+str(c)