def hash_value(x,y):
    return (x,y)
    xy = 10**9
    x+=xy
    y+=xy
    return (x*xy*xy) + y
def is_abc(a,b,c):
    dab = ((a[0]-b[0])**2)+((a[1]-b[1])**2)
    dbc = ((c[0]-b[0])**2)+((c[1]-b[1])**2)
    dca = ((c[0]-a[0])**2)+((a[1]-c[1])**2)
    ds = [dab,dbc,dca]
    ds.sort()
    if(ds[0]+ds[1]==ds[2]):
        return True
    else:
        return False
def calc_slope(a,b):
    x1=a[0]
    y1=a[1]
    x2=b[0]
    y2=b[1]
    if(x2==x1):
        return True
    if(y1==y2):
        return True
    return False
inp =[int(i) for i in raw_input().split()]
all_pts = [(hash_value(inp[0],inp[1]),hash_value(inp[2],inp[3]))]
inp =[int(i) for i in raw_input().split()]
all_pts += [(hash_value(inp[0],inp[1]),hash_value(inp[2],inp[3]))]
inp =[int(i) for i in raw_input().split()]
all_pts += [(hash_value(inp[0],inp[1]),hash_value(inp[2],inp[3]))]
inp =[int(i) for i in raw_input().split()]
all_pts += [(hash_value(inp[0],inp[1]),hash_value(inp[2],inp[3]))]
pts = {}
for i in all_pts:
    x = i[0]
    y = i[1]
    if(x  in pts):
        pts[x]+=[y]
    else:
        pts[x]=[y]
    if(y  in pts):
        pts[y]+=[x]
    else:
        pts[y]=[x]
ans = True
for i in all_pts:
    if(calc_slope(i[0],i[1])==False):
        ans=False
    if(len(pts[i[0]])!=2):
       ans = False
    if(len(pts[i[1]])!=2):
       ans = False
for i in all_pts:
    if(ans==False):
        break
    a= i[0]
    b = pts[x][0]
    c = pts[x][1]
    if(is_abc(a,b,c)==False):
        ans=False
    a= i[1]
    b = pts[x][0]
    c = pts[x][1]
    if(is_abc(a,b,c)==False):
        ans=False
if(ans):
    print "YES"
else:
    print "NO"
