T=int(raw_input())
for a in range(T):
    b=raw_input()
    N,P=b.split()
    N=int(N)
    P=int(P)
    c=raw_input()
    poe=c.split()
    ans=0
    if str(P) not in poe:
        print 'NO',ans
    else:
        for c in range(N):
            if int(poe[c])>P:
                ans+=1
        print 'YES',ans