import java.io.*;
import java.util.*;
import java.math.*;


public class FourSegments
{
	public Scanner in;
	public PrintWriter out;
	
	FourSegments()
	{
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
	}
	
	FourSegments(String i, String o) throws FileNotFoundException
	{
		in = new Scanner(new File(i));
		out = new PrintWriter(new File(o));
	}
	
	public void finalize()
	{
		out.flush();
		in.close();
		out.close();
	}
	
	public double dist(int[] v)
	{
		return Math.sqrt(Math.pow(v[0] - v[2], 2) + Math.pow(v[1] - v[3], 2));
	}
	
	public void solve()
	{
		int x1, x2, y1, y2;
		int[] v = new int[4];
		double[] ar = new double[4];
		
		for(int i = 0; i < 4; ++i)
		{
			for(int j = 0; j < 4; ++j)
				v[j] = in.nextInt();
			
			ar[i] = dist(v);
		}
		
		/*
		for(double val : ar)
			out.println(val);
		*/
		
		Arrays.sort(ar);
		
		if((ar[0] == ar[1] && ar[2] == ar[3]) || (ar[0] == ar[1] && ar[2] == ar[3]))
			out.println("YES");
		else
			out.println("NO");
	}
	
	public static void main(String[] args)
	{
		FourSegments t = new FourSegments();
		t.solve();
		t.finalize();
	}
}

