a=int(raw_input())
outt=[]
for k in range(a):
    b=map(int, raw_input().split())
    d=(map(int, raw_input().split()))
    cc=0
    if b[1] in d:
        for j in d:
            if j>b[1]:
				cc+=1
        outt.append("YES "+str(cc))
    else:
        outt.append("NO "+str(0))
for kk in outt:
    print kk