import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {
	static double eps = 1e-9;
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> cnt = new ArrayList<Integer>();
		ArrayList<Pair> distinct = new ArrayList<Pair>();
		for (int i = 0; i < 4; i++) 
		{
			int x0 = sc.nextInt() , y0 = sc.nextInt();
			int x1 = sc.nextInt() , y1 = sc.nextInt();
			double slope = Math.abs(((y1-y0)/(1.0*x1-x0)));
			if(x0!=x1 &&  slope>eps   )
			{
				System.out.println("NO");
				return;
			}
			
			boolean f1 = false, f2 = false;
			for (int j = 0; j < distinct.size(); j++) {
				if(distinct.get(j).x==x0 && distinct.get(j).y==y0)
				{
					f1 = true;
					cnt.set(j, cnt.get(j)+1);
				}
				if(distinct.get(j).x==x1 && distinct.get(j).y==y1)
				{
					f2 = true;
					cnt.set(j, cnt.get(j)+1);
				}
			}
			if(!f1){
				distinct.add(new Pair(x0,y0));
				cnt.add(1);
			}
			if(!f2){
				distinct.add(new Pair(x1, y1));
				cnt.add(1);
			}
			
		}
		for(int i : cnt)
			if(i!=2)
			{
				System.out.println("NO");
				return;
			}
		if(distinct.size()==4)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
	
	static class Pair
	{
		int x,y;
		public Pair(int a,int b) {
			x = a;y = b;
		}
	}
	

	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;
		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(s));
		}
		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException {return Integer.parseInt(next());}
		public String nextLine() throws IOException {return br.readLine();}		
		public long nextLong() throws IOException {return Long.parseLong(next());}		
		public double nextDouble() throws IOException {return Double.parseDouble(next());}	
		public char nextChar() throws IOException{return next().charAt(0);}
		public boolean ready() throws IOException {return br.ready();}
		public int[] nextIntArr() throws IOException{
			st = new StringTokenizer(br.readLine());
			int[] res = new int[st.countTokens()];
			for (int i = 0; i < res.length; i++)
				res[i] = nextInt();
			return res;
		}
		public char[] nextCharArr() throws IOException{
			st = new StringTokenizer(br.readLine());
			char[] res = new char[st.countTokens()];
			for (int i = 0; i < res.length; i++) 
				res[i] = nextChar();
			return res;
		}
	}

	static int MAX(int ...a)
	{
		int ans = Integer.MIN_VALUE;
		for(int i : a)
			if(i>ans)ans = i;
		return ans;		
	}
	
	static long MAX(long ...a)
	{
		long ans = Long.MIN_VALUE;
		for(long i : a)
			if(i>ans)ans = i;
		return ans;	
	}
	
	static int MIN(int ...a)
	{
		int ans = Integer.MAX_VALUE;
		for(int i : a)
			if(i<ans)ans = i;
		return ans;		
	}
	
	static long MIN(long ...a)
	{
		long ans = Long.MAX_VALUE;
		for(long i : a)
			if(i<ans)ans = i;
		return ans;		
	}

}