import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FourSegments {

	static class Pair {
		int x, y;

		public Pair(int xx, int yy) {
			x = xx;
			y = yy;
		}
	}

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		Pair[][] arr = new Pair[4][2];
		for (int i = 0; i < 4; i++) {
			String s = r.readLine();
			String[] sp = s.split(" ");
			Pair a = new Pair(new Integer(sp[0]), new Integer(sp[1]));
			Pair b = new Pair(new Integer(sp[2]), new Integer(sp[3]));
			arr[i][0] = a;
			arr[i][1] = b;
		}

		boolean[] taken = new boolean[4];
		taken[0] = true;
		Pair end = arr[0][0];
		Pair curr = arr[0][1];
		boolean can = true;
		for (int j = 0; j < 3; j++) {
			boolean find = false;
			for (int i = 1; i < taken.length; i++) {
				if (taken[i])
					continue;
				if (equals(arr[i][0], curr)) {
					find = true;
					taken[i] = true;
					curr = arr[i][1];
					break;
				}
				if (equals(arr[i][1], curr)) {
					find = true;
					taken[i] = true;
					curr = arr[i][0];
					break;
				}
			}
			if (!find) {
				can = false;
			}
		}
		if (!equals(curr, end))
			can = false;
		if (all(arr))
			can = false;
		for (int i = 0; i < taken.length; i++) {
			if (!taken[i])
				can = false;
		}
		for (int i = 0; i < taken.length; i++) {
			if(isH(arr[i])&&isV(arr[i])){
				can=false;
			}
			else if(isH(arr[i])||isV(arr[i])){
				
			}
			else can=false;
		}
		int h=0,v=0;
		for (int i = 0; i < taken.length; i++) {
			if(isH(arr[i]))h++;
			if(isV(arr[i]))v++;
		}
		if(h==2&&v==2){
			
		}
		else can=false;
		if (can)
			System.out.println("YES");
		else
			System.out.println("NO");
	}

	private static boolean isV(Pair[] pairs) {
		return pairs[0].y==pairs[1].y;
	}

	private static boolean isH(Pair[] pairs) {
		// TODO Auto-generated method stub
		return pairs[0].x==pairs[1].x;
	}

	private static boolean all(Pair[][] arr) {
		Pair x=arr[0][0];
		for (int i = 0; i < arr.length; i++) {
			for (int j = 0; j < arr[i].length; j++) {
				if(!equals(x,arr[i][j]))return false;
			}
		}
		return true;
	}

	private static boolean equals(Pair pair, Pair curr) {
		return pair.x==curr.x && pair.y==curr.y;
	}
}
