# https://tjkendev.github.io/procon-library/python/geometry/circles_associated_with_triangle.html def circumcircle(P1, P2, P3): x1, y1 = P1 x2, y2 = P2 x3, y3 = P3 a = 2 * (x1 - x2) b = 2 * (y1 - y2) p = x1**2 - x2**2 + y1**2 - y2**2 c = 2 * (x1 - x3) d = 2 * (y1 - y3) q = x1**2 - x3**2 + y1**2 - y3**2 det = a * d - b * c if det == 0: return None x = d * p - b * q y = a * q - c * p if det < 0: x = -x y = -y det = -det x /= det y /= det r2 = (x - x1) ** 2 + (y - y1) ** 2 return x, y, r2 Q = int(input()) xa, ya, xb, yb, xc, yc = map(int, input().split()) res = circumcircle((xa, ya), (xb, yb), (xc, yc)) if res is None: Ps = [(xa, ya), (xb, yb), (xc, yc)] Ps.sort() x1, y1 = Ps[0] x2, y2 = Ps[2] cx = (x1 + x2) / 2 cy = (y1 + y2) / 2 r2 = (cx - x1) ** 2 + (cy - y1) ** 2 else: cx, cy, r2 = res eps = 1e-7 for _ in range(Q): x, y = map(int, input().split()) d2 = (x - cx) ** 2 + (y - cy) ** 2 if d2 <= r2 + eps: print("Yes") else: print("No")