
import java.util.ArrayList;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Madi
 */
public class FourSegments {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] in;
        ArrayList<MPoint> point = new ArrayList<MPoint>();
        boolean f = true;

        for (int i = 0; i < 4; i++) {
            f = true;
            in = sc.nextLine().split(" ");
            MPoint p1 = new MPoint(Long.parseLong(in[0]), Long.parseLong(in[1]));
            MPoint p2 = new MPoint(Long.parseLong(in[2]), Long.parseLong(in[3]));
            for (int j = 0; j < point.size(); j++) {
                if (p1.compare(point.get(j))) {
                    f = false;
                }
            }
            if (f) {
                point.add(p1);
            }
            f = true;
            for (int j = 0; j < point.size(); j++) {
                if (p2.compare(point.get(j))) {
                    f = false;
                }
            }
            if (f) {
                point.add(p2);
            }
        }

        if (point.size() != 4) {
            System.out.println("NO");
        } else {
            double a1 = area(point.get(0), point.get(1), point.get(2));
            double a2 = area(point.get(0), point.get(3), point.get(2));
            double a3 = area(point.get(0), point.get(1), point.get(3));
            double b1 = area(point.get(1), point.get(0), point.get(2));
            double b2 = area(point.get(1), point.get(0), point.get(3));
            double b3 = area(point.get(1), point.get(3), point.get(2));
            double c1 = area(point.get(2), point.get(1), point.get(3));
            double c2 = area(point.get(2), point.get(1), point.get(0));
            double c3 = area(point.get(2), point.get(3), point.get(0));
            double d1 = area(point.get(3), point.get(1), point.get(2));
            double d2 = area(point.get(3), point.get(1), point.get(0));
            double d3 = area(point.get(3), point.get(0), point.get(2));

            double dist1 = dist(point.get(0), point.get(1));
            double dist2 = dist(point.get(0), point.get(2));
            double dist3 = dist(point.get(0), point.get(3));

            double max = Math.max(Math.max(dist1, dist2), dist3);
            double min = Math.min(Math.min(dist1, dist2), dist3);
            double mid = dist1 + dist2 + dist3 - max - min;

            double area1 = (a1 + a2 + a3 + b1 + b2 + b3 + c1 + c2 + c3 + d1 + d2 + d3) / 6;
            double area2 = min * mid;

            if (Math.abs(area1 - area2) < 0.00001) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }

    }

    private static double area(MPoint a, MPoint b, MPoint c) {
        double sideC = Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
        double sideA = Math.sqrt((c.x - b.x) * (c.x - b.x) + (c.y - b.y) * (c.y - b.y));
        double sideB = Math.sqrt((a.x - c.x) * (a.x - c.x) + (a.y - c.y) * (a.y - c.y));

        double u = (sideA + sideB + sideC) / 2;

        return Math.sqrt(u * (u - sideA) * (u - sideB) * (u - sideC));
    }

    private static double dist(MPoint a, MPoint b) {
        return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
    }
    
}

class MPoint {
    long x;
    long y;

    MPoint(long x, long y) {
        this.x = x;
        this.y = y;
    }

    public boolean compare(MPoint p) {
        return (this.x == p.x && this.y == p.y);
    }
}