t = int(raw_input())
while t:
    t-=1
    n, p = map(int, raw_input().split())
    a = map(int, raw_input().split())
    if p not in a:
        print 'NO 0'
    else:
        print 'YES', len([i for i in a if i > p])