import sys from fractions import Fraction input = sys.stdin.readline def read_values(): return tuple(map(int, input().split())) def main(): q=int(input()) xa,ya,xb,yb,xc,yc=read_values() ab2=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb) bc2=(xb-xc)*(xb-xc)+(yb-yc)*(yb-yc) ca2=(xc-xa)*(xc-xa)+(yc-ya)*(yc-ya) if ab2>=bc2+ca2: ox=Fraction(xa+xb,2) oy=Fraction(ya+yb,2) r2=(ox-xa)*(ox-xa)+(oy-ya)*(oy-ya) elif bc2>=ab2+ca2: ox=Fraction(xc+xb,2) oy=Fraction(yc+yb,2) r2=(ox-xc)*(ox-xc)+(oy-yc)*(oy-yc) elif ca2>=ab2+bc2: ox=Fraction(xc+xa,2) oy=Fraction(yc+ya,2) r2=(ox-xa)*(ox-xa)+(oy-ya)*(oy-ya) else: ox=Fraction((xa*xa+ya*ya)*(yb-yc)+(xb*xb+yb*yb)*(yc-ya)+(xc*xc+yc*yc)*(ya-yb),((yb-yc)*(xa-xb)-(ya-yb)*(xb-xc))*2) oy=Fraction((xa*xa+ya*ya)*(xb-xc)+(xb*xb+yb*yb)*(xc-xa)+(xc*xc+yc*yc)*(xa-xb),((xb-xc)*(ya-yb)-(xa-xb)*(yb-yc))*2) r2=(ox-xa)*(ox-xa)+(oy-ya)*(oy-ya) for _ in range(q): x,y=read_values() rr2=(ox-x)*(ox-x)+(oy-y)*(oy-y) if rr2<=r2: print('Yes') else: print('No') if __name__ == "__main__": main()