import math
p = []
v = []
h = []
for i in range(4):
	p.append([int (a) for a in input().strip().split()])

result = 1
vlen = []
hlen = []
for l in p:
	if l[0] == l[2]:
		v.append(l)
		vlen.append(abs(l[1] - l[3]))
	elif l[1] == l[3]:
		h.append(l)
		hlen.append(abs(l[0] - l[2]))
	else:
		result = 0

if vlen[0] != vlen[1]:
	result = 0
if hlen[0] != hlen[1]:
	result = 0	

x = 0
for l in v:
	for hl in h:
		if not ((l[0] == hl[0] and l[1] == hl[1]) or (l[0] == hl[2] and l[1] == hl[3]) or (l[2] == hl[0] and l[3] == hl[1]) or (l[2] == hl[2] and l[3] == hl[3])):
			x = 1
if x == 1:
	result = 0
		
if result == 1:
	print("YES")
else:
	print("NO")