import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

// TODO #14 C

public class R014C {
    boolean isEqual(long a, long b) { return a == b; }
    boolean isEqual(Point p1, Point p2) { return p1.equals(p2); }
    
    class Point {
        // てん クラス
        long x, y;
        public Point(long x, long y) { this.x = x; this.y = y; }
        public Point(Point p) { this(p.x, p.y); }
        public Point move(long x, long y) { return new Point(this.x + x, this.y + y); }
        public Vector vector(Point that) { return new Vector(this.x - that.x, this.y - that.y); }
        public long lengthSquare() { return x * x + y * y; }
        public int hashCode() { return (int)(x * 17) + (int)(y * 31); }
        public boolean equals(Object o) {
            if(!(o instanceof Point)) return false;
            Point that = (Point)o;
            return isEqual(this.x, that.x) && isEqual(this.y , that.y);
        }
        public String toString() { return x + ", " + y; }
    }
    
    class Vector {
        // ベクトル クラス
        long x, y;
        public Vector(long x, long y) { this.x = x; this.y = y; }
        public Vector move(long x, long y) { return new Vector(this.x + x, this.y + y); }
        /** ないせき */
        public long innerProduct(Vector that) { return this.x * that.x + this.y * that.y; }
        /** ながさ */
        public double length() { return Math.hypot(x, y); }
        /** ながさの2じょう */
        public long lengthSquare() { return x * x + y * y; }
        /** いっちょくせんじょうにあるか */
        public boolean isColinear(Vector that) { return this.y * that.x == this.x * that.y; }
        public int hashCode() { return (int)(x * 17) + (int)(y * 31); }
        public boolean equals(Object o) {
            if(!(o instanceof Vector)) return false;
            Vector that = (Vector)o;
            return isEqual(this.x, that.x) && isEqual(this.y, that.y);
        }
        public String toString() { return x + ", " + y; }
    }
    
    class Segment {
        // せんぶん クラス
        Point p1, p2;
        public Segment(Point p1, Point p2) { this.p1 = p1; this.p2 = p2; }
        /** おなじ せんぶん かどうか */
        public boolean isSameSegment(Segment that) { return this.equals(that); }
        /** おなじ たんてん をもつかどうか */
        public boolean hasCommonEndpoint(Segment that) {
            if(this.p1.equals(that.p1)) return true;
            if(this.p1.equals(that.p2)) return true;
            if(this.p2.equals(that.p1)) return true;
            if(this.p2.equals(that.p2)) return true;
            return false;
        }
        /** おなじ たんてん をもつとき、その たんてん をもとめる */
        public Point getCommonEndpoint(Segment that) {
            if(!hasCommonEndpoint(that)) return null;
            if(this.p1.equals(that.p1)) return new Point(this.p1);
            if(this.p1.equals(that.p2)) return new Point(this.p1);
            if(this.p2.equals(that.p1)) return new Point(this.p2);
            if(this.p2.equals(that.p2)) return new Point(this.p2);
            return null;
        }
        public Segment move(long x, long y) { return new Segment(this.p1.move(x, y), this.p2.move(x, y)); }
        public int hashCode() { return p1.hashCode() + p2.hashCode(); }
        public boolean equals(Object o) {
            if(!(o instanceof Segment)) return false;
            Segment that = (Segment)o;
            return (isEqual(this.p1, that.p1) && isEqual(this.p2, that.p2))
            || (isEqual(this.p1, that.p2) && isEqual(this.p2, that.p1));
        }    
        public String toString() { return "(" + p1 + " : " + p2 + ")"; }
        public Point anotherPoint(Point p) {
            if(p.equals(p1)) return p2;
            else return p1;
        }
    }
    
    Segment[] segments;
    
    public R014C() {
        Scanner scanner = new Scanner(System.in);
        segments = new Segment[4];
        for(int i=0; i<4; i++) {            
            Point p1 = new Point(scanner.nextInt(), scanner.nextInt());
            Point p2 = new Point(scanner.nextInt(), scanner.nextInt());
            segments[i] = new Segment(p1, p2);
        }
    }
    
    private String calc() {
        Set<Point> points = new HashSet<Point>();
        for(int i=0; i<4; i++) {
            points.add(segments[i].p1);
            points.add(segments[i].p2);
        }
        if(points.size() != 4)
            return "NO";
        Set<Segment> segmentSet = new HashSet<Segment>();
        for(int i=0; i<4; i++) {
            segmentSet.add(segments[i]);
        }
        if(segmentSet.size() != 4)
            return "NO";
        for(int i=0; i<4; i++) {
            for(int j=0; j<4; j++) {
                if(i == j) continue;
                if(segments[i].hasCommonEndpoint(segments[j])) {
                    Point endPoint = segments[i].getCommonEndpoint(segments[j]);
                    Point anotheri = segments[i].anotherPoint(endPoint);
                    Point anotherj = segments[j].anotherPoint(endPoint);
                    Vector vi = new Vector(anotheri.x - endPoint.x, anotheri.y - endPoint.y);
                    Vector vj = new Vector(anotherj.x - endPoint.x, anotherj.y - endPoint.y);
                    if(vi.innerProduct(vj) != 0) return "NO";
                }
            }
        }
        return "YES";
    }
    
    private void process() {
        System.out.println(calc());
    }
    
    public static void main(String[] args) {
        new R014C().process();
    }
}
