for i in range(int(input())):
    a,b=map(int,raw_input().split())
    x=map(int,raw_input().split())
    c=0
    if b in x:
       for j in range(len(x)):
           if x[j]>b:
               c+=1
       print "YES %d"%c
    else:
        print "NO 0"