t = int(input())
p = []
for _ in range(t):
    n = int(input())
    center = []
    for _ in range(n):
        a,b = map(int,input().split())
        center.append((a,b))
    xs,ys,xt,yt = map(int,input().split())

    d = (xs - xt)**2 + (ys - yt) **2

    possible = True
    distances = list(map(lambda a : (a[0] - xt)**2 + (a[1] - yt)**2, center))
    for i in range(n):
        if distances[i] <= d:
            possible = False

    if possible:
        p.append("YES")
    else:
        p.append("NO")
for x in p:
    print(x)
