import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;

public class Solution implements Runnable {
    
    public static void main(String[] args) {
        (new Thread(new Solution())).start();
    }
    
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;
    
    String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
    
    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    
    class Point {
        int x, y;
        Point() {
            try {
                x = nextInt();
                y = nextInt();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        boolean eq(Point b) {
            return x == b.x && y == b.y;
        }
    }
    
    class Otr {
        Point a, b;
        Otr() {
            a = new Point(); b = new Point();
        }
        boolean bad() {
            boolean res = a.eq(b);
            if (!res) {
                return a.x != b.x && a.y != b.y;
            } else return true;
        }
    }
    
    void solve() throws Exception {
        Otr[] a = new Otr[4];
        boolean ans = true;
        for (int i = 0; i < 4; i++) {
            a[i] = new Otr();
            if (a[i].bad()) {
                ans = false;
                break;
            }
        }
        if (ans) {
            for (int i = 0; i < 4; i++) {
                int q = -1, w = -1;
                for (int j = 0; j < 4; j++) {
                    if (i != j) {
                        if (a[i].a.eq(a[j].a) || a[i].a.eq(a[j].b)) {
                            if (q != -1) ans = false;
                            q = j;
                        }
                        if (a[i].b.eq(a[j].a) || a[i].b.eq(a[j].b)) {
                            if (w != -1) ans = false;
                            w = j;
                        }
                    }
                }
                if (q == -1 || w == -1 || q == w) {
                    ans = false;
                    break;
                }
            }
        }
        if (ans) out.print("YES"); else out.print("NO");
    }
    
    public void run() {
        try {
            Locale.setDefault(Locale.US);
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
        } catch (Exception e) {
            e.printStackTrace();
        }
        out.flush();
    }

}
