t=input()
while t>0:
	t-=1
	a=raw_input().split()
	powers=raw_input().split()
	n=int(a[0])
	p=int(a[1])
	count=0
	flag=0
	s=""
	for i in powers:
		x=int(i)
		if x>p:
			count+=1
		elif x==p:
			flag=1
	if flag==1:
		s="YES "+str(count)
	else:
		s="NO 0"
	print(s)