def main():  
  line_1 = input().strip().split()
  line_1 = list(map(int, line_1))
  line_2 = input().strip().split()
  line_2 = list(map(int, line_2))
  line_3 = input().strip().split()
  line_3 = list(map(int, line_3))
  line_4 = input().strip().split()
  line_4 = list(map(int, line_4))

  x_line_count = 0
  y_line_count = 0
  # y_lines = []
  # x_lines = []
  points = {}

  if line_1 == line_2 or line_1 == line_3 or line_1 == line_4 or line_2 == line_3 or line_2 == line_4 or line_3 == line_4:
    return 'NO'

  for line in (line_1, line_2, line_3, line_4):
    if line[0] == line[2] and line[1] != line[3]:
      x_line_count += 1
      # x_lines.append(line)
    elif line[1] == line[3] and line[0] != line[2]:
      y_line_count += 1
      # y_lines.append(line)
    if (line[0], line[1]) in points:
      points[(line[0], line[1])] += 1
    else:
      points[(line[0], line[1])] = 1
    if (line[2], line[3]) in points:
      points[(line[2], line[3])] += 1
    else:
      points[(line[2], line[3])] = 1

  if x_line_count != 2 or y_line_count != 2:
    return 'NO'

  if len(points) != 4:
    print(points)
    return 'NO'

  return 'YES'



print(main())
   	  	 	    	 			 	 		  	