otrs = [list(map(int, raw_input().split())) for i in range(4)]
hor = []
vert = []
no = False
for i in range(4):
    otrs[i] = sorted( [ (otrs[i][0], otrs[i][1]), (otrs[i][2], otrs[i][3]) ] )
    if otrs[i][0][0] == otrs[i][1][0]: vert += [otrs[i]]
    elif otrs[i][0][1] == otrs[i][1][1]: hor += [otrs[i]]

if len(hor) != 2 or len(vert) != 2: no = True
if not no:
    s1 = set(hor[0] + hor[1])
    s2 = set(vert[0] + vert[1])
    no = s1 != s2

print("NO" if no else "YES")