import sys input = sys.stdin.readline def read_values(): return tuple(map(int, input().split())) def read_list(): return list(read_values()) def area(x1,y1,x2,y2,x3,y3): return x1*y2+x2*y3+x3*y1-y2*x3-y3*x1-y1*x2 q=int(input()) xa,ya,xb,yb,xc,yc=read_values() sqa = (xb - xc) * (xb - xc) + (yb - yc) * (yb - yc) sqb = (xc - xa) * (xc - xa) + (yc - ya) * (yc - ya) sqc = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) if sqb>=sqa and sqb>=sqc: xa,xb,ya,yb=xb,xa,yb,ya elif sqc>=sqa and sqc>=sqb: xa,xc,ya,yc=xc,xa,yc,ya sqa = (xb - xc) * (xb - xc) + (yb - yc) * (yb - yc) sqb = (xc - xa) * (xc - xa) + (yc - ya) * (yc - ya) sqc = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) if sqa>=sqb+sqc: for _ in range(q): xi,yi=read_values() bd=(xb - xi) * (xb - xi) + (yb - yi) * (yb - yi); cd=(xc - xi) * (xc - xi) + (yc - yi) * (yc - yi); if bd+cd<=sqa: print('Yes') else: print('No') else: a1=area(xb,yb,xc,yc,xa,ya) num=(xb - xa) * (xc - xa) + (yb - ya) * (yc - ya) num*=num dem=sqb*sqc for _ in range(q): xi,yi=read_values() bd=(xb - xi) * (xb - xi) + (yb - yi) * (yb - yi); cd=(xc - xi) * (xc - xi) + (yc - yi) * (yc - yi); inner=(xb - xi) * (xc - xi) + (yb - yi) * (yc - yi) numi=inner*inner demi=bd*cd ai=area(xb,yb,xc,yc,xi,yi) if a1*ai>=0: if inner < 0 or numi * dem <= num * demi: print('Yes') else: print('No') else: if inner <= 0 and numi * dem >= num * demi: print('Yes') else : print('No')