for _ in xrange(input()):
	n, p = map(int, raw_input().split())
	lst = map(int, raw_input().split())
	cnt = 0
	if p in lst:
		for i in lst:
			if i > p:
				cnt += 1
		print "YES", cnt
	else:
		print "NO", cnt