import java.util.*;
import java.awt.Point;
import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(in);
        Point[] a = new Point[4];
        Point[] b = new Point[4];
        
        boolean _NO = false;
        for(int i=0;i<4;i++){
            a[i] = new Point(sc.nextInt(), sc.nextInt());
            b[i] = new Point(sc.nextInt(), sc.nextInt());
            if(a[i].x < 0 || a[i].y < 0 || b[i].x < 0 || b[i].y < 0){
                _NO = true;
            }
        }
        if(_NO){
            System.out.println("NO");
            return;
        }
        
        Point[] v = new Point[4];
        for(int i=0;i<4;i++){
            v[i] = new Point(a[i].x-b[i].x, a[i].y-b[i].y);
        }
        
        Point[] vv;
        Point[] aa; Point[] bb;
        
        //0,1
        vv = v; aa = a; bb = b;
        if(len(vv) && deg(vv) && ten(aa, bb)){
            out.println("YES"); return;
        }
        
        //0,2
        vv = new Point[4];
        aa = new Point[4]; bb = new Point[4];
        vv[0] = v[0]; vv[1] = v[2];
        aa[0] = a[0]; aa[1] = a[2];
        bb[0] = b[0]; bb[1] = b[2];
        
        vv[2] = v[1]; vv[3] = v[3];
        aa[2] = a[1]; aa[3] = a[3];
        bb[2] = b[1]; bb[3] = b[3];
        
        if(len(vv) && deg(vv) && ten(aa, bb)){
            out.println("YES"); return;
        }
        
        //0, 3
        vv[0] = v[0]; vv[1] = v[3];
        aa[0] = a[0]; aa[1] = a[3];
        bb[0] = b[0]; bb[1] = b[3];
        
        vv[2] = v[1]; vv[3] = v[2];
        aa[2] = a[1]; aa[3] = a[2];
        bb[2] = b[1]; bb[3] = b[2];

        if(len(vv) && deg(vv) && ten(aa, bb)){
            out.println("YES"); return;
        }
        
        System.out.println("NO");
    }
    private static double det(Point v){
        return new Point(0, 0).distance(v);
    }
    static boolean ten(Point[] a, Point[] b){
        if(a[0].equals(a[1]) || a[0].equals(b[1])
            ||
            b[0].equals(a[1]) || b[0].equals(b[1])) return false;
        if(a[2].equals(a[3]) || a[2].equals(b[3])
                ||
                b[2].equals(a[3]) || b[2].equals(b[3])) return false;
        
        if(a[0].equals(a[2]) || a[0].equals(b[2])
            ||
            a[0].equals(a[3]) || a[0].equals(b[3])){}
        else return false;
        if(b[0].equals(a[2]) || b[0].equals(b[2])
                ||
                b[0].equals(a[3]) || b[0].equals(b[3])){}
        else return false;
            
        if(a[1].equals(a[2]) || a[1].equals(b[2])
                ||
                a[1].equals(a[3]) || a[1].equals(b[3])){}
        else return false;
        if(b[1].equals(a[2]) || b[1].equals(b[2])
                ||
                b[1].equals(a[3]) || b[1].equals(b[3])){}
        else return false;
        
        return true;
    }
    static boolean len(Point[] v){
        if(det(v[0]) != det(v[1])) return false;
        if(det(v[2]) != det(v[3])) return false;
        return true;
    }
    static boolean deg(Point[] v){
        //parallel
        if((long)v[0].x * (long)v[1].y - (long)v[0].y * (long)v[1].x != 0L) return false;
        if((long)v[2].x * (long)v[3].y - (long)v[2].y * (long)v[3].x != 0L) return false;
        
        //suichoku
        if((long)v[0].x * (long)v[2].x + (long)v[0].y * (long)v[2].y != 0L) return false;
        
        return true;
    }
}
