t = input()
for i in range(t):
	s = raw_input().split()
	n = int(s[0])
	p = int(s[1])
	arr = [int(x) for x in raw_input().split()]
	if (p not in arr):
		print "NO " + str(0)
		continue
	count = 0
	for x in arr:
		if(x>p):
			count+=1
	print "YES " + str(count)