accepted = True
lines = []
dic = {}
for i in range(4):
	line = list(map(int,input().split(" ")))
	
	lines.append(((line[0], line[1]),(line[2],line[3])))
	if not (line[0] == line[2] or line[1] == line[3]): accepted = False
	if lines[-1][0] not in dic.keys():
		dic[lines[-1][0]] = [(i, 0)]
	else: dic[lines[-1][0]].append((i,0))
	if lines[-1][1] not in dic.keys():
		dic[lines[-1][1]] = [(i, 1)]
	else: dic[lines[-1][1]].append((i,1))
zero, one = set(), set()
for key in dic.keys():
	if len(set(dic[key])) != 2: accepted = False
	zero.add(key[0])
	one.add(key[1])
if len(zero) == 1 or len(one) == 1: accepted = False
print("YES") if accepted else print("NO")

#http://codeforces.com/problemset/problem/14/C