import java.awt.Point;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class C {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		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());
			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(p1);
		}
		if (corners.keySet().size() != 4) {
			System.out.println("NO");
			return;
		}
		for(Point p : corners.keySet()){
			List<Point> lines = corners.get(p);
			if(lines.size()!=2){
				System.out.println("NO");
				return;	
			}
			Point p1 = lines.get(0), p2 = lines.get(1);
			if(!((p.x==p1.x&&p.y==p2.y)||(p.y==p1.y&&p.x==p2.x))){
				System.out.println("NO");
				return;	
			}
		}
		System.out.println("YES");
	}
}
