import java.awt.Point;
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<Point> points = new HashSet<Point>();
		Map<Point, List<Point>> corners = new HashMap<Point, List<Point>>();
		for (int n = 4; n-- > 0;) {
			Point p1 = new Point(scan.nextInt(), scan.nextInt());
			Point p2 = new Point(scan.nextInt(), scan.nextInt());
			points.add(p1);
			points.add(p2);
			if(!corners.containsKey(p1)){
				corners.put(p1, new ArrayList<Point>());
			}
			corners.get(p1).add(p2);
			if(!corners.containsKey(p2)){
				corners.put(p2, new ArrayList<Point>());
			}
			corners.get(p2).add(p2);
		}
		if (points.size() != 4) {
			System.out.println("NO");
			return;
		}
		for(Point p : points){
			List<Point> lines = corners.get(p);
			if(lines.size()!=2){
				System.out.println("NO");
				return;				
			}
			Point p1 = lines.get(0);
			p1.setLocation(p1.x-p.x, p1.y-p.y);
			Point p2 = lines.get(1);
			p2.setLocation(p2.x-p.x, p2.y-p.y);
//			if(Math.round(p1.x*p2.x+p1.y*p2.y)!=0){
			if(!((p1.x==0&&p2.y==0)||(p1.y==0&&p2.x==0))){
				System.out.println("NO");
				return;				
			}
		}
		System.out.println("YES");
	}
}
