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