import sys

dic = {}
for i in xrange(4):
    x1, y1, x2, y2 = map(int, raw_input().split())

    if x1 != x2 and y1 != y2:
        print "NO"
        exit(0)

    if (x1, y1) not in dic:
        dic[(x1, y1)] = 1
    else:
        dic[(x1, y1)] = 2

    if (x2, y2) not in dic:
        dic[(x2, y2)] = 1
    else:
        dic[(x2, y2)] = 2

        
for p in dic:
    if dic[p] != 2:
        print "NO"
        exit(0)

print "YES"
