arr=[]
for i in range(4):
  x1,y1,x2,y2=map(int,raw_input().split())
  arr.append((x1,y1))
  arr.append((x2,y2))
arr=list(set(arr))
x=[]
y=[]
for i in arr:
  x.append(i[0])
  y.append(i[1])
if len(arr)<>4:
  print 'NO'
  exit()
if min(x)==max(x) or min(y) == max(y):
  print 'NO'
  exit()
ans=0
for i in arr:
  if (i[0]==min(x) and i[1]==min(y)) or (i[0]==max(x) and i[1]==max(y)) or (i[0]==min(x) and i[1]==max(y)) or (i[0]==max(x) and i[1]==min(y)):
    ans+=1
if ans==4:
  print 'YES'
else:
  print 'NO'