v=[map(int,raw_input().split()) for _ in range(4)]
for t in v:
  if t[0]>t[2] or (t[0]==t[2] and t[1]>t[3]):t[0],t[1],t[2],t[3]=t[2],t[3],t[0],t[1]
x,y=list(set([t[0] for t in v])|set(t[2] for t in v)),list(set(t[1] for t in v)|set(t[3] for t in v))
print 'YES' if 2==len(x) and 2==len(y) and set([(x[0],y[0],x[0],y[1]),(x[0],y[0],x[1],y[0]),(x[0],y[1],x[1],y[1]),(x[1],y[0],x[1],y[1])])==set(map(tuple,v)) else 'NO'
