import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

public class template {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner(System.in);
		HashMap<String,Integer> HM = new HashMap<String,Integer>();
		for(int a=0;a<4;a++){
			int x1 = sc.nextInt();
			int y1 = sc.nextInt();
			int x2 = sc.nextInt();
			int y2 = sc.nextInt();
			if((x1==x2&&y1==y2)||((x1!=x2)&&(y1!=y2))){
				System.out.println("NO");
				System.exit(0);
			}
			String one  = x1+" "+y1;
			String two = x2+" "+y2;
			if(HM.containsKey(one))HM.put(one,HM.get(one)+1);
			else HM.put(one, 1);
			if(HM.containsKey(two))HM.put(two,HM.get(two)+1);
			else HM.put(two,1);
			
		}
		if(HM.size()==4){
			boolean flag = true;
			for(int x : HM.values()){
				if(x!=2)System.out.println("NO");
				System.exit(0);
			}
			System.out.println("YES");
		}
		else System.out.println("NO");
				
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) throws Exception {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer(br.readLine().trim());
		}

		public int numTokens() throws Exception {
			if (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine().trim());
				return numTokens();
			}
			return st.countTokens();
		}

		public String next() throws Exception {
			if (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine().trim());
				return next();
			}
			return st.nextToken();
		}

		public double nextDouble() throws Exception {
			return Double.parseDouble(next());
		}

		public float nextFloat() throws Exception {
			return Float.parseFloat(next());
		}

		public long nextLong() throws Exception {
			return Long.parseLong(next());
		}

		public int nextInt() throws Exception {
			return Integer.parseInt(next());
		}

		public String nextLine() throws Exception {
			return br.readLine().trim();
		}
	}

}
