p=[tuple(map(int,input().split())) for i in range(4)] def X(a,b,c): ax,ay=a bx,by=b cx,cy=c return (ax-cx)*(by-cy)-(ay-cy)*(bx-cx) def C(p): p.sort() c1=[] for np in p: while len(c1)>=2 and X(np,c1[-2],c1[-1])>=0: c1.pop() c1+=[np] p.reverse() c2=[] for np in p: while len(c2)>=2 and X(np,c2[-2],c2[-1])>=0: c2.pop() c2+=[np] c1.pop() c2.pop() return c1+c2 p=C(p) if len(p)<4: print("NO") exit() d=lambda p1,p2:(p1[0]-p2[0])**2+(p1[1]-p2[1])**2 A=d(p[0],p[1])*d(p[2],p[3]) B=d(p[1],p[2])*d(p[3],p[0]) C=d(p[0],p[2])*d(p[1],p[3]) print(["NO","YES"][C-A-B>=0 and 4*A*B==(C-A-B)**2])