import sys # sys.setrecursionlimit(200005) # sys.set_int_max_str_digits(200005) int1 = lambda x: int(x)-1 pDB = lambda *x: print(*x, end="\n", file=sys.stderr) p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr) def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] # inf = -1-(-1 << 31) inf = -1-(-1 << 62) # md = 10**9+7 md = 998244353 from math import gcd from fractions import Fraction # t=0 2点 # t=1 傾き分子、傾き分母、1点 class Line: def __init__(self, x1, y1, x2, y2, t=0): a, b, c = y2-y1, x1-x2, x2*y1-x1*y2 if t == 1: a, b, c = x1*2, -y1*2, y1*y2-x1*x2 if a < 0: a, b, c = -a, -b, -c g = gcd(a, gcd(b, c)) self.a, self.b, self.c = a//g, b//g, c//g def __eq__(self, other): return self.a == other.a and self.b == other.b and self.c == other.c def online(self, x, y): return self.a*x+self.b*y+self.c == 0 # 交点の座標(分数) def crossf(self, other): if self == other: return "same", "same" if self.a*other.b == self.b*other.a: return "none", "none" return Fraction(self.c*other.b - self.b*other.c,self.b*other.a - self.a*other.b) , Fraction(self.c*other.a - self.a*other.c,self.a*other.b - self.b*other.a) # 交点の座標(実数) def crossr(self, other): if self == other: return "same", "same" if self.a*other.b == self.b*other.a: return "none", "none" return (self.c*other.b - self.b*other.c)/(self.b*other.a - self.a*other.b) , (self.c*other.a - self.a*other.c)/(self.a*other.b - self.b*other.a) def d2(i,j): x,y=abc[i],abc[i+1] s,t=abc[j],abc[j+1] return (x-s)**2+(y-t)**2 def midpoint(i,j): x,y=abc[i],abc[i+1] s,t=abc[j],abc[j+1] return Fraction(x+s,2),Fraction(y+t,2) def trend(i,j): x,y=abc[i],abc[i+1] s,t=abc[j],abc[j+1] return y-t,x-s q=II() abc=LI() a=d2(0,2) b=d2(0,4) c=d2(2,4) mx=max(a,b,c) # print(a,b,c) if 2*mx>a+b+c: if mx==a:[ox,oy],r=midpoint(0,2),Fraction(a,4) if mx==b:[ox,oy],r=midpoint(0,4),Fraction(b,4) if mx==c:[ox,oy],r=midpoint(2,4),Fraction(c,4) else: n,d=trend(0,2) x,y=abc[0]+abc[2],abc[1]+abc[3] l1=Line(d,-n,x,y,1) n,d=trend(0,4) x,y=abc[0]+abc[4],abc[1]+abc[5] l2=Line(d,-n,x,y,1) ox,oy=l1.crossf(l2) r=(ox-abc[0])**2+(oy-abc[1])**2 # print(ox,oy,r) for _ in range(q): x,y=LI() print("Yes" if (x-ox)**2+(y-oy)**2<=r else "No")