for _ in range(input()):
    n,p=map(int,raw_input().split())
    l=sorted(map(int,raw_input().split()))
    r=[]
    c=0
    if p in l:
        for items in l:
            if p<items:
                r.append(items)
                c+=1
        print 'YES',c  
    else:
        print 'NO', 0