s1=list(map(int, input().split()))
s2=list(map(int, input().split()))
s3=list(map(int, input().split()))
s4=list(map(int, input().split()))
coords=[]
coords.append((s1[0], s1[1]))
coords.append((s1[2], s1[3]))
coords.append((s2[0], s2[1]))
coords.append((s2[2], s2[3]))
coords.append((s3[0], s3[1]))
coords.append((s3[2], s3[3]))
coords.append((s4[0], s4[1]))
coords.append((s4[2], s4[3]))
coords=list(set(coords))
coords.sort()
for i in range(0, len(coords)):
    coords[i]=complex(coords[i][0],coords[i][1])
coorddiffs=[]
a=coords[0]
b=coords[1]
c=coords[3]
d=coords[2]
coorddiffs.append(b-a)
coorddiffs.append(c-b)
coorddiffs.append(d-c)
coorddiffs.append(a-d)
print(coords)
print(coorddiffs)
coorddiffsmag=[abs(x) for x in coorddiffs]

J=complex(0,1)
count=0
for i in range(0,len(coorddiffs)):
    next_seg=coorddiffs[i]*J*coorddiffsmag[(i+1)%4]
    if next_seg in coorddiffs:
        count+=1
if(count>=2):
    print("YES")
else:
    print("NO")
