import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StreamTokenizer;


public class Main {

	/**
	 * @param args
	 */
	public static byte scal(int x1, int y1, int x2, int y2) {
		int res = x1*x2 + y1*y2;
		if (res == 0) {
			return 1;
		}
		else{
			return 0;
		}
	}
	public static byte paral(int x1, int y1, int x2, int y2) {
		boolean check = (Math.abs(x1) == Math.abs(x2)) && (Math.abs(y1) == Math.abs(y2)) ;
		if (check) {
			return 1;
		}
		else {
			return 0;
		}
	}
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
//		BufferedReader input = new BufferedReader(new FileReader("input.txt"));
//		BufferedWriter output = new BufferedWriter(new FileWriter("output.txt"));
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
		StreamTokenizer in = new StreamTokenizer(input);
		in.nextToken();
		int x1 = (int)in.nval;
		in.nextToken();
		int y1 = (int)in.nval;
		in.nextToken();
		int x2 = (int)in.nval;
		in.nextToken();
		int y2 = (int)in.nval;
		in.nextToken();
		int x3 = (int)in.nval;
		in.nextToken();
		int y3 = (int)in.nval;
		in.nextToken();
		int x4 = (int)in.nval;
		in.nextToken();
		int y4 = (int)in.nval;
		in.nextToken();
		int x5 = (int)in.nval;
		in.nextToken();
		int y5 = (int)in.nval;
		in.nextToken();
		int x6 = (int)in.nval;
		in.nextToken();
		int y6 = (int)in.nval;
		in.nextToken();
		int x7 = (int)in.nval;
		in.nextToken();
		int y7 = (int)in.nval;
		in.nextToken();
		int x8 = (int)in.nval;
		in.nextToken();
		int y8 = (int)in.nval;
		int xvec1 = x2 - x1;
		int yvec1 = y2 - y1;
		int xvec2 = x4 - x3;
		int yvec2 = y4 - y3;
		int xvec3 = x6 - x5;
		int yvec3 = y6 - y5;
		int xvec4 = x8 - x7;
		int yvec4 = y8 - y7;
		byte count = 0;
		count += scal(xvec1, yvec1, xvec2, yvec2);
		count += scal(xvec1, yvec1, xvec3, yvec3);
		count += scal(xvec1, yvec1, xvec4, yvec4);
		count += scal(xvec2, yvec2, xvec3, yvec3);
		count += scal(xvec2, yvec2, xvec4, yvec4);
		count += scal(xvec3, yvec3, xvec4, yvec4);
		boolean res;
		res = count == 4;
		if (res) {
			int count2 = 0;
			count2 += paral(xvec1, yvec1, xvec2, yvec2);
			count2 += paral(xvec1, yvec1, xvec3, yvec3);
			count2 += paral(xvec1, yvec1, xvec4, yvec4);
			count2 += paral(xvec2, yvec2, xvec3, yvec3);
			count2 += paral(xvec2, yvec2, xvec4, yvec4);
			count2 += paral(xvec3, yvec3, xvec4, yvec4);
			res = count2 == 2;
		}
		if (res) {	
			output.write("YES");
		}
		else {
			output.write("NO");
		}
		input.close();
		output.close();
	}

}
