import java.io.*;


public class Main {

	static BufferedReader input;
	static PrintWriter output;
	static StreamTokenizer in;
	
	public static void main(String[] args) throws IOException {
		input = new BufferedReader(new InputStreamReader(System.in));
//		input = new BufferedReader(new FileReader("input.txt"));
		output = new PrintWriter(System.out);

		
		Line[] lines = new Line[4];
		lines[0] = new Line(nextLong(), nextLong(), nextLong(), nextLong());
		lines[1] = new Line(nextLong(), nextLong(), nextLong(), nextLong());
		lines[2] = new Line(nextLong(), nextLong(), nextLong(), nextLong());
		lines[3] = new Line(nextLong(), nextLong(), nextLong(), nextLong());
		
		for (int i=0; i<4; i++) {
			for (int j=i+1; j<4; j++) {
				if ( (!lines[i].use1) && (!lines[j].use1) ) {
					if ( (lines[i].x1 == lines[j].x1) && (lines[i].y1 == lines[j].y1) ) {
						lines[i].use1 = true;
						lines[j].use1 = true;
					}
				}
				if ( (!lines[i].use1) && (!lines[j].use2) ) {
					if ( (lines[i].x1 == lines[j].x2) && (lines[i].y1 == lines[j].y2) ) {
						lines[i].use1 = true;
						lines[j].use2 = true;
					}
				}
				if ( (!lines[i].use2) && (!lines[j].use1) ) {
					if ( (lines[i].x2 == lines[j].x1) && (lines[i].y2 == lines[j].y1) ) {
						lines[i].use2 = true;
						lines[j].use1 = true;
					}
				}
				if ( (!lines[i].use2) && (!lines[j].use2) ) {
					if ( (lines[i].x2 == lines[j].x2) && (lines[i].y2 == lines[j].y2) ) {
						lines[i].use2 = true;
						lines[j].use2 = true;
					}
				}
			}
		}
		

		boolean found = true;
		
		for (int i=0; i<4; i++) {
			if ( (!lines[i].use1) || (!lines[i].use2) ) {
				found = false;
				break;
			}
		}
		
		
		//��������������
		if (found) {
			for (int i=0; i<4; i++) {
				if ( (lines[i].x1 == lines[i].x2) || (lines[i].y1 == lines[i].y2) ) {
					found = true; // �������� %:(
				} else {
					found = false;
					break;
				}
			}
		}

		
		//0 �������
		if (found) {
			for (int i=0; i<4; i++) {
				if ( (lines[i].x1 == lines[i].x2) && (lines[i].y1 == lines[i].y2) ) {
					found = false;
					break;
				}
			}
		}

		
		//Equals
		if (found) {
			for (int i=0; i<4; i++) {
				for (int j=i+1; j<4; j++) {
					if (
							(lines[i].x1 == lines[j].x1) && (lines[i].y1 == lines[j].y1) &&
							(lines[i].x2 == lines[j].x2) && (lines[i].y2 == lines[j].y2)
						) {
						found = false;
						break;
					}
				}
			}
		}
		
		
		//Sq
		if (found) {
			found = false;
			if ( 
					(lines[0].length()*lines[1].length() == lines[2].length()*lines[3].length()) ||
					(lines[0].length()*lines[2].length() == lines[1].length()*lines[3].length()) ||
					(lines[0].length()*lines[3].length() == lines[1].length()*lines[2].length())
				) {
				found = true;
			}
		}

			
		
		
		
		if (found) {
			write("YES");
		} else {
			write("NO");
		}
		
	}
	


	static String nextString() throws IOException {
        if ( in == null ) {
            in = new StreamTokenizer(input);
        }
        in.nextToken();
        return in.sval;
    }


    static double nextDouble() throws NumberFormatException, IOException {
        if ( in == null ) {
            in = new StreamTokenizer(input);
        }
        in.nextToken();
        return in.nval;
    }

    
    static int nextInt() throws NumberFormatException, IOException {
        return (int) nextDouble();
    }
    
    
    static long nextLong() throws NumberFormatException, IOException {
        return (long) nextDouble();
    }
    
 
    static void write(String st) {
    	System.out.print(st);
    }

    
    static void writeln(String st) {
    	System.out.print(st + "\n");
    }
    
}



class Line {
	long x1;
	long y1;
	long x2;
	long y2;
	
	boolean use1;
	boolean use2;
	
	
	public Line(long x1, long y1, long x2, long y2) {
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
		
		use1 = false;
		use2 = false;
	}
	
	public long length() {
		return Math.max(Math.abs(x1-x2), Math.abs(y1-y2));
	}
}

