for _ in range(input()):
  n,p_sam = map(int,raw_input().strip().split())
  l = list(map(int,raw_input().strip().split()))
  l = sorted(l)
  #print l
  if p_sam not in l:
  	print "NO 0"
  else:
  	print "YES",len(l)-1-l.index(p_sam)