'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
testcases = int(raw_input())
while(testcases):
	info = [int(x) for x in raw_input().split()]
	power = [int(x) for x in raw_input().split()]
	count = 0
	if info[1] in power:
		#no_of_gangsters = info[0] - 1
		for items in power:
			if items > info[1]:
				count += 1
		print 'YES '+str(count)
	else:
		print 'NO '+'0'
	testcases -= 1