t=input()
while t:
    t-=1
    [n,p]=map(int, raw_input().split())
    g=map(int,raw_input().split())
    i=0
    count=0
    flag=0
    while i<len(g):
        if g[i]>p:
            count+=1
        elif g[i]==p:
            flag=1
        i+=1
    if flag==0:
        print "NO 0"
    else:
        print "YES",
        print count