import java.util.Arrays;
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner r = new Scanner(System.in);
		
		Edge[] edges = new Edge[8];
		for(int i = 0; i < 4; i++){
			int a = r.nextInt();
			int b = r.nextInt();
			int c = r.nextInt();
			int d = r.nextInt();
			edges[i] = new Edge(new Point(a, b),
									new Point(c, d));
		}
		
		boolean can = dfs(0, edges, new Edge[4], new boolean[4]);
		
		if(can)System.out.println("YES");
		else System.out.println("NO");
	}

	private static boolean dfs(int i, Edge[] a, Edge[] p, boolean[] v) {
		if(i == 4){
			for(int x = 0; x < 2; x++){
				for(int y = 0; y < 2; y++){
					for(int z = 0; z < 2; z++){
						for(int w = 0; w < 2; w++){
							if(x == 1)p[0].swap();
							if(y == 1)p[1].swap();
							if(z == 1)p[2].swap();
							if(w == 1)p[3].swap();
							
//							System.out.println(Arrays.toString(p));
							if(p[0].p1.x == p[1].p1.x && p[0].p1.y == p[1].p1.y){}else continue;
							if(p[1].p2.x == p[3].p1.x && p[1].p2.y == p[3].p1.y){}else continue;
							if(p[0].p2.x == p[2].p1.x && p[0].p2.y == p[2].p1.y){}else continue;
							if(p[3].p2.x == p[2].p2.x && p[2].p2.y == p[2].p2.y){}else continue;
							
							if(p[0].p1.y == p[0].p2.y){}else continue;
							if(p[3].p1.y == p[3].p2.y){}else continue;
							if(p[1].p1.x == p[1].p2.x){}else continue;
							if(p[2].p1.x == p[2].p2.x){}else continue;
							
							if(x == 1)p[0].swap();
							if(y == 1)p[1].swap();
							if(z == 1)p[2].swap();
							if(w == 1)p[3].swap();
							
							return true;			
						}
					}
				}
			}
			
			return false;
		}else{
			boolean can = false;
			for(int j = 0; j < 4; j++)if(!v[j]){
				v[j] = true;
				p[i] = a[j];
				
				can |= dfs(i+1, a, p, v);
				
				v[j] = false;
			}
			return can;
		}
	}
}

class Edge{
	Point p1, p2;
	public Edge(Point p1i, Point p2i){
		p1 = p1i;
		p2 = p2i;
	}
	void swap(){
		Point t = p1;
		p1 = p2;
		p2 = t;
	}
}
class Point{
	int x, y;
	public Point(int xi, int yi){
		x = xi;
		y = yi;
	}
}