t = input()
while(t):
    t -= 1
    arr = []
    count = 0
    n,p = map(int,raw_input().split()) 
    arr = list(map(int,raw_input().split()))
    if p in arr:
        for x in arr:
            if(x>p):
                count += 1
        print "YES",count
    else:
        print "NO",count