import math def distance(x1, y1, x2, y2): return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) def solve(): Q = int(input()) XA, YA, XB, YB, XC, YC = map(int, input().split()) luggage = [list(map(int, input().split())) for _ in range(Q)] D = 2 * (XA * (YB - YC) + XB * (YC - YA) + XC * (YA - YB)) if D != 0: UX = ((XA * XA + YA * YA) * (YB - YC) + (XB * XB + YB * YB) * (YC - YA) + (XC * XC + YC * YC) * (YA - YB)) / D UY = ((XA * XA + YA * YA) * (XC - XB) + (XB * XB + YB * YB) * (XA - XC) + (XC * XC + YC * YC) * (XB - XA)) / D r = distance(UX, UY, XA, YA) else: dAB = distance(XA, YA, XB, YB) dBC = distance(XB, YB, XC, YC) dCA = distance(XC, YC, XA, YA) if dAB >= max(dBC, dCA): UX, UY, r = (XA + XB) / 2, (YA + YB) / 2, dAB / 2 elif dBC >= max(dAB, dCA): UX, UY, r = (XB + XC) / 2, (YB + YC) / 2, dBC / 2 else: UX, UY, r = (XC + XA) / 2, (YC + YA) / 2, dCA / 2 for xi, yi in luggage: if distance(UX, UY, xi, yi) <= r: print("Yes") else: print("No") solve()