t=input()
while t:
	t-=1
	n,s = [int(x) for x in raw_input().split()]
	a = [int(x) for x in raw_input().split()]
	found = False
	res=0
	for x in a:
		if x == s:
			found = True
		if x > s:
			res+=1
	if found:
		print("YES"),
		print(res)
	else:
		print("NO"),
		print(0)