
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * 111118315581
 *
 * @author pttrung
 */
public class C {

    public static long x, y, gcd;

    public static void main(String[] args) {
        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        Seg[] data = new Seg[4];
        for (int i = 0; i < 4; i++) {
            data[i] = new Seg(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
        }
        int a = -1;
        int b = -1;
        for (int i = 0; i < 4; i++) {
            if (data[i].isHor()) {
                if (a == -1) {
                    a = i;
                } else {
                    b = i;
                }
            }
        }
        //System.out.println(a + " " + b);
        if (a == -1 || b == -1) {
            out.println("NO");
        } else {
            int min = Math.min(data[a].x1, data[a].x2);
            int max = Math.max(data[a].x1, data[a].x2);
            int c = Math.min(data[b].x1, data[b].x2);
            int d = Math.max(data[b].x1, data[b].x2);
            int minY = Math.min(data[a].y1, data[b].y1);
            int maxY = Math.max(data[a].y1, data[b].y1);
            if(min != c || max != d){
                out.println("NO");
            }else{
                boolean found = true;
                for(int i = 0; i < 4; i++){
                    if(i != a && i != b){
                        int e = Math.min(data[i].y1,data[i].y2);
                        int f = Math.max(data[i].y1,data[i].y2);
                        if(!data[i].isVer()|| (data[i].x1 != min && data[i].x1 != max)){
                            found = false;
                            break;
                        }
                        if(e != minY || f != maxY){
                            found = false;
                            break;
                        }
                        if(data[i].x1 == min){
                            min = Integer.MAX_VALUE;
                        }else if(data[i].x1 == max){
                            max = Integer.MIN_VALUE;
                        }
                    }
                }
                if(!found){
                    out.println("NO");
                }else{
                    out.println("YES");
                }
            }
        }
        out.close();
    }

    public static class Seg {

        int x1, y1, x2, y2;

        public Seg(int x1, int y1, int x2, int y2) {
            this.x1 = x1;
            this.y1 = y1;
            this.x2 = x2;
            this.y2 = y2;
        }

        public boolean isHor() {
            return y1 == y2;
        }

        public boolean isVer() {
            return x1 == x2;
        }
    }

    public static void extendEuclid(long a, long b) {
        if (b == 0) {
            x = 1;
            y = 0;
            gcd = a;
            return;
        }
        extendEuclid(b, a % b);
        long x1 = y;
        long y1 = x - (a / b) * y;
        x = x1;
        y = y1;

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}
