import java.util.Scanner;

public class FourSegments {

	static Integer x, y;
	static boolean valid;
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		x = null;
		y = null;
		valid = true;
		int[] coordinates = new int[4];
		//scan the four sides
		for (int i = 0; i < 4 && valid ; i++) {
			//scan the two coordinates
			for (int j = 0; j < 4; j++) {
				coordinates[j] = scan.nextInt();
			}
			checkValid(coordinates);
		}
		if (valid) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	
	private static void checkValid(int[] coor) {
		//if same x coordinate
		if (coor[0] == coor[2]) {
			if (x == null) {
				x = Math.abs(coor[1] - coor[3]);
			} else {
				if (Math.abs(coor[1] - coor[3]) != x) {
					valid = false;
				}
			}
		}
		//if same y coordinate
		else if (coor[1] == coor[3]) {
			if (y == null) {
				y = Math.abs(coor[0] - coor[2]);
			} else {
				if (Math.abs(coor[0] - coor[2]) != y) {
					valid = false;
				}
			}
		}
		else {
			valid = false; //not parallel to axis
		}
	}
	
}
