#!/usr/bin/env python
# -*- coding:utf-8 -*-
#

from math import sqrt

def readint(): return int(raw_input())
def readfloat(): return float(raw_input())
def readarray(N, foo):
        res = []
        for _ in xrange(N):
                res.append(foo())
        return res
def readlinearray(foo): return map(foo, raw_input().split())

def get_len(((x1, y1), (x2, y2))):
    return sqrt( (x2 - x1) ** 2 + (y2 - y1) ** 2) 

def seg_length_ok(points):
    seg1, seg2, seg3, seg4 = points
    return get_len(seg1) == get_len(seg3) and get_len(seg2) == get_len(seg4)

def first_point_equals_last(points):
    return points[0][0] == points[-1][1]

def found_cycle_size_four(seg1, segs, cresult):
    
    if len(cresult) > 4: return False
    
    (seg1p1, seg1p2) = seg1
    for seg in segs:
        segp1, segp2 = seg
        if seg1 == seg: continue
        if seg1p1 == segp2 and seg1p2 == segp1: continue
        if seg1p2 == segp1:
            if len(cresult) == 4 and seg_length_ok(cresult) and first_point_equals_last(cresult): return True
            cresult.append(seg)
            return found_cycle_size_four(seg, segs, cresult)
    return False

def is_rectangle(segs):
    
    nsegs = []
    for seg in segs:
        p1, p2 = seg
        if p1 != p2:
            nsegs.append((p2, p1))
    segs = segs + nsegs
    
    for seg in segs:
        if found_cycle_size_four(seg, segs, [seg]):
            return True
        
    return False

if __name__ == '__main__':
    x1, y1, x2, y2 = readlinearray(int)
    seg1 = ((x1, y1), (x2, y2))
    
    x1, y1, x2, y2 = readlinearray(int) 
    seg2 = ((x1, y1), (x2, y2))
    
    x1, y1, x2, y2 = readlinearray(int)
    seg3 = ((x1, y1), (x2, y2))
    
    x1, y1, x2, y2 = readlinearray(int)
    seg4 = ((x1, y1), (x2, y2))
    
    segs = [seg1, seg2, seg3, seg4]
    if is_rectangle(segs):
        print 'YES'
    else:
        print 'NO'
