import java.awt.Point;
import java.io.*;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Hashtable;
public class C14
{
	public static void main(String args[])throws IOException
	{
		BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter ob=new PrintWriter(System.out);
		Hashtable<Integer,Integer> ht=new Hashtable<Integer,Integer>();
		Hashtable<Point,Integer> tem=new Hashtable<Point,Integer>();
		//System.out.println(ht.size());
		StringTokenizer st=new StringTokenizer(in.readLine());	
		int x1=Integer.parseInt(st.nextToken());
		int y1=Integer.parseInt(st.nextToken());
		//st=new StringTokenizer(in.readLine());
		int x2=Integer.parseInt(st.nextToken());
		int y2=Integer.parseInt(st.nextToken());
		int d1=(int)Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		st=new StringTokenizer(in.readLine());
		int x3=Integer.parseInt(st.nextToken());
		int y3=Integer.parseInt(st.nextToken());
	//	st=new StringTokenizer(in.readLine());
		int x4=Integer.parseInt(st.nextToken());
		int y4=Integer.parseInt(st.nextToken());
		int d2=(int)Math.sqrt((x3-x4)*(x3-x4)+(y3-y4)*(y3-y4));
			st=new StringTokenizer(in.readLine());	
		int x5=Integer.parseInt(st.nextToken());
		int y5=Integer.parseInt(st.nextToken());
		//st=new StringTokenizer(in.readLine());
		int x6=Integer.parseInt(st.nextToken());
		int y6=Integer.parseInt(st.nextToken());
		int d3=(int)Math.sqrt((x5-x6)*(x5-x6)+(y5-y6)*(y5-y6));
		st=new StringTokenizer(in.readLine());
		int x7=Integer.parseInt(st.nextToken());
		int y7=Integer.parseInt(st.nextToken());
		//st=new StringTokenizer(in.readLine());
		int x8=Integer.parseInt(st.nextToken());
		int y8=Integer.parseInt(st.nextToken());
		int d4=(int)Math.sqrt((x7-x8)*(x7-x8)+(y7-y8)*(y7-y8));
		int m1,m2,m3,m4;
		int p=0,q=0;
		if(x2-x1==0)
			{m1=1;p+=1;}
		else
		{
			m1=(y2-y1)/(x2-x1);
			if(m1==0)
				q+=1;
		}
		if(x4-x3==0)
			{m2=1;p+=1;}
		else
		{
			m2=(y3-y4)/(x3-x4);
			if(m2==0)
				q+=1;
		}
		if(x5-x6==0)
			{m3=1;p+=1;}
		else
		{
			m3=(y5-y6)/(x5-x6);
			if(m3==0)
			{
				q+=1;
			}
		}
		if(x7-x8==0)
			{m4=1;p+=1;}
		else
		{
			m4=(y7-y8)/(x7-x8);
			if(m4==0)
			{
				q+=1;
			}
		}
		//System.out.println(p+" "+q);
		if(p==2 && q==2)
		{
			int a=x1,b=x2,c=x3,d=x4,e=y1,f=y2,g=y3,h=y4;
			int xor=a^b^c^d^e^f^g^h;
			tem.put(new Point(x1,y1),1);
			tem.put(new Point(x2,y2),1);
			tem.put(new Point(x3,y3),1);
			tem.put(new Point(x4,y4),1);
			tem.put(new Point(x5,y5),1);
			tem.put(new Point(x6,y6),1);
			tem.put(new Point(x7,y7),1);
			tem.put(new Point(x8,y8),1);
			//System.out.println(xor+" "+tem.size());
			if(xor==0 && tem.size()==4)
			{
				int maxx=Math.max(x1,x2);
				maxx=Math.max(maxx,x3);
				maxx=Math.max(maxx,x4);
				int maxy=Math.max(y1,y2);
				maxy=Math.max(maxy,y3);
				maxy=Math.max(maxy,y4);
				int minx=Math.min(x1,x2);
				minx=Math.min(minx,x3);
				minx=Math.min(minx,x4);
				int miny=Math.min(y1,y2);
				miny=Math.min(miny,x3);
				miny=Math.min(miny,x4);
				miny=Math.abs(miny);
				minx=Math.abs(minx);
				int posarea=maxx*maxy;
				
				if(maxy>=miny && maxx>=minx)
				{
					int ind=0;
					
					ht.put(d1,d1);
					ht.put(d2,d2);
					ht.put(d3,d3);
					ht.put(d4,d4);
					long unique[]=new long[4];
					for(Integer  s: ht.keySet() )
					{
						unique[ind++]=s;
					}
					long area=0;
					if(ind==1)
						area=unique[0]*unique[0];
					else
						area=unique[0]*unique[1];
					//System.out.println(area+" "+posarea);
					if(area>posarea)
						System.out.print("NO");
					else
					System.out.print("YES");
				}
				else
					System.out.print("NO");
			}
			else
				System.out.print("NO");
		}
		else
			{
				System.out.println("NO");
			}
	}
	}