t = int(raw_input())
for tt in range(t) :
    n,p = [int(i) for i in raw_input().split()]
    a = [int(i) for i in raw_input().split()]
    ans = 0
    pre = "NO"
    if p in a :
        pre = "YES"
        for each in a :
            if each > p :
                ans += 1
    print pre,
    print ans