t=int(raw_input())
while t>0:
	t-=1;
	cnt=0;
	n,p=(int(i) for i in raw_input().split());
	l=[int(i) for i in raw_input().split()];
	if p in l :
		print"YES",
		for i in l:
			if i > p: cnt+=1;
	else:print "NO",
	print cnt;