for T in range(input()):
	n, p = map(int, raw_input().rstrip().split(' '))
	gang = [int(i) for i in raw_input().rstrip().split(' ')]
	if p in gang:
		gang = sorted(gang)[::-1]
		print "YES %d" % (gang.index(p))
	else:
		print "NO 0"