import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class C {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		Set<Point2D> points = new HashSet<Point2D>();
		Map<Point2D, List<Line2D>> corners = new HashMap<Point2D, List<Line2D>>();
		for (int n = 4; n-- > 0;) {
			Point2D p1 = new Point2D.Float(scan.nextFloat(), scan.nextFloat());
			Point2D p2 = new Point2D.Float(scan.nextFloat(), scan.nextFloat());
			points.add(p1);
			points.add(p2);
			if(!corners.containsKey(p1)){
				corners.put(p1, new ArrayList<Line2D>());
			}
			corners.get(p1).add(new Line2D.Float(p1, p2));
			if(!corners.containsKey(p2)){
				corners.put(p2, new ArrayList<Line2D>());
			}
			corners.get(p2).add(new Line2D.Float(p2, p1));
		}
//		if (points.size() != 4) {
//			System.out.println("NO");
//			return;
//		}
		for(Point2D p : points){
			List<Line2D> lines = corners.get(p);
			if(lines.size()!=2){
				System.out.println("NO");
				return;				
			}
			Point2D p1 = lines.get(0).getP1().equals(p)?lines.get(0).getP2():lines.get(0).getP1();
			p1.setLocation(p1.getX()-p.getX(), p1.getY()-p.getY());
			Point2D p2 = lines.get(1).getP1().equals(p)?lines.get(1).getP2():lines.get(1).getP1();
			p2.setLocation(p2.getX()-p.getX(), p2.getY()-p.getY());
			if(Math.round(p1.getX()*p2.getX()+p1.getY()*p2.getY())!=0){
				System.out.println("NO");
				return;				
			}
		}
		System.out.println("YES");
	}
}
