import java.util.*;
import java.io.*;
public class Main{

        BufferedReader in;
        StringTokenizer str = null;
        PrintWriter out;

        private String next() throws Exception{
                if (str == null || !str.hasMoreTokens())
                        str = new StringTokenizer(in.readLine());
                return str.nextToken();
        }
        
        private int nextInt() throws Exception{
                return Integer.parseInt(next());
        }
        
        private long nextLong() throws Exception{
                return Long.parseLong(next());
        }
        
        private double nextDouble() throws Exception{
                return Double.parseDouble(next());
        }

        public void run() throws Exception{
                in = new BufferedReader(new InputStreamReader(System.in));//new FileReader();
                out = new PrintWriter(System.out);//new File();
                line l[] = new line[4];
                for(int i=0;i<4;i++){
                  l[i] = new line(nextInt(), nextInt(), nextInt(), nextInt());
                  if (!l[i].isValid()){
                    out.println("NO");
                    out.close();
                    return;
                  }
                }
                for(int i=0;i<4;i++)
                  for(int j=i+1;j<4;j++)
                    if (same(l[i],l[j])){
                      out.println("NO");
                      out.close();
                      return;
                    }
                boolean used[] = new boolean[4];
                int cnt = 0;
                int curx = l[0].x2;
                int cury = l[0].y2;
                int index = 0;
                while(true){
                  boolean found = false;
                  for(int i=0;i<4;i++)if (!used[i] && index!=i){
                      if (curx == l[i].x1 && cury == l[i].y1){
                        curx = l[i].x2;
                        cury = l[i].y2;
                        used[i] = true;
                        found = true;
                        cnt++;
                        index = i;
                        break;
                      }else if(curx == l[i].x2 && cury == l[i].y2){
                        curx = l[i].x1;
                        cury = l[i].y1;
                        used[i] = true;
                        found = true;
                        cnt++;
                        index = i;
                        break;
                      }
                    }
                  
                  if (cnt == 4){
                    out.println("YES");
                    out.close();
                    return;
                  }  
                  if (!found){
                    out.println("NO");
                    out.close();
                    return;
                  }
                }
        }
        
        private boolean same(line a, line b){
          if (a.x1 == b.x1 && a.x2 == b.x2 && a.y1 == b.y1 && a.y2 == b.y2) return true;
          if (a.x1 == b.x2 && a.x2 == b.x1 && a.y1 == b.y2 && a.y2 == b.y1) return true;
          return false;
        }
        
        public static void main(String args[]) throws Exception{
                new Main().run();
        }
}
class line{
  int x1, x2,y1,y2;
  public line(int x1, int y1, int x2, int y2){
    this.x1 = x1;
    this.y1 = y1;
    this.y2 = y2;
    this.x2 = x2;
  }
  public boolean isValid(){
    if (x1 == x2 && y1 == y2) return false;
    return (x1 == x2 || y1 == y2);
  }
}
