import java.io.*;
import java.util.*;
public class Foursegment {
public static void main(String[] args) throws Exception
{
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw=new PrintWriter(System.out);
    int[] a=new int[4];
    int[] b=new int[4];
    int[] c=new int[4];
    int[] d=new int[4];
    double[] l=new double[4];
    //HashMap<pair,Integer> h=new HashMap<pair,Integer>();
    pair[] p=new pair[8];
    int count=-1;
    for(int i=0;i<4;i++)
    {
        StringTokenizer st=new StringTokenizer(br.readLine());
        a[i]=Integer.parseInt(st.nextToken());
        b[i]=Integer.parseInt(st.nextToken());
        c[i]=Integer.parseInt(st.nextToken());
        d[i]=Integer.parseInt(st.nextToken());
        
        pair p1=new pair(a[i],b[i]);
        boolean aaa=false;
            for(int z=0;z<=count;z++)
            {
                if(p[z].x==p1.x && p[z].y==p1.y)
                {
                    aaa=true;
                    break;
                }
            }
        if(!aaa)
        {
            p[++count]=p1;
        }
            
        
        pair p2=new pair(c[i],d[i]);
        aaa=false;
        for(int z=0;z<=count;z++)
        {
            if(p[z].x==p2.x && p[z].y==p2.y)
            {
                aaa=true;
                break;
            }
        }
    if(!aaa)
    {
        p[++count]=p2;
    }
        int x1=Math.abs(a[i]-c[i]);
        int x2=Math.abs(b[i]-d[i]);
        l[i]=Math.sqrt(x1*x1+x2*x2);
    }
    //System.out.println("count is"+count);
    /*for(int i=0;i<=count;i++)
    {
        System.out.println(p[i].x+" "+p[i].y);
    }*/
    if(count!=3)
    {
        System.out.println("NO");
        System.exit(0);
    }
    boolean[] ans=new boolean[4];
    for(int i=0;i<4;i++)
    {
        if(!ans[i])
        {
            for(int j=i+1;j<4;j++)
            {
                if(l[i]==l[j])
                {
                    ans[j]=true;
                    ans[i]=true;
                }
            }
            
        }
        if(!ans[i])
        {
            System.out.println("NO");
            System.exit(0);
        }
    }
    System.out.println("YES");
    
    pw.close();
}
}
class pair implements Comparable<pair>
{
    int x;
    int y;
    public pair(int x,int y)
    {
        this.x=x;
        this.y=y;
    }
    @Override
    public int compareTo(pair p) {
        if(p.x==this.x && p.y==this.y)
        {
        return 0;
        }
        return -1;
    }
    
}