t = int(raw_input())

while t>0:
	t-=1
	n,m = map(int, raw_input().split())
	li = map(int, raw_input().split())
	if m in li:
		print "YES",
		ans = 0
		for i in li:
			if i>m:
				ans+=1
		print ans
	else:
		print "NO 0"