from sys import stdin
for i in xrange(int(stdin.readline())):
	a=map(int, stdin.readline().split())
	b=map(int, stdin.readline().split())
	b.sort(reverse=True)
	if a[1] in b:
		print 'YES',b.index(a[1])
	else:
		print 'NO',0