# https://qiita.com/tatesuke/items/59133758ec25146766c3 from math import hypot Q = int(input()) a, b, c, d, e, f = map(float, input().split()) if abs((c - a) * (f - b) - (d - b) * (e - a)) < 1e-9: px = (max(a, c, e) + min(a, c, e)) / 2.0 py = (max(b, d, f) + min(b, d, f)) / 2.0 r = hypot(px - a, py - b) else: aa = a * a bb = b * b cc = c * c dd = d * d ee = e * e ff = f * f py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f)) px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \ if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a)) r = hypot(px - a, py - b) for _ in range(Q): x, y = map(float, input().split()) if (px - x) ** 2 + (py - y) ** 2 > r * r: print("No") else: print("Yes")