f=0
m=0
s=[]
for i in range(int(input())):
   a,b = map(int,raw_input().split())
   s=[int(x) for x in raw_input().split()]
   s.sort()
   if b in s:
      m= sum(i>b for i in s)
      print ("YES"),
      print(m)
   else:
      print("NO"),
      print(f)