q = []
for i in range(4):
    a, b, c, d = map(int, input().split())
    w = []
    w.append(a)
    w.append(b)
    q.append(w[::])
    w = []
    w.append(c)
    w.append(d)
    q.append(w[::])
q.sort()
e = []
for i in range(8):
    e.append(q[i][1])
e.sort()
if q[0] == q[1] and q[2] == q[3] and q[4] == q[5] and q[6] == q[7] and q[0] != q[7]:
    if e[0] == e[1] and e[0] == e[2] and e[0] == e[3] and e[4] == e[5] and e[4] == e[6] and e[4] == e[7] and e[0] != e[7]:
        print("YES")
    else:
        print("NO")
else:
    print("NO")