t = int(raw_input())
for i in xrange(t):
	n,p = map(int,raw_input().split())
	a = list(map(int,raw_input().split()))
	a.sort()
	count = 0
	try:
		a.index(p)
	except:
		print 'NO','0'
	else:
		for j in range(n):
			if a[j] > p:
				count += 1
			if j==n-1:
				print 'YES',count