t = int(raw_input())
while t>0:
	t-=1
	flag = False
	c = 0
	n, p = map(int, raw_input().split())
	a = map(int, raw_input().split())
	for ai in a:
		if ai == p:
			flag = True
		if ai > p:
			c+=1
	if flag:
		print "YES "+str(c)
	else:
		print "NO 0"