#include <bits/stdc++.h>
using namespace std;
int n, sx[10], id[10], sy[10], fx[10], fy[10], SX[10], SY[10], FX[10], FY[10];
int main() {
  for (int i = 1; i <= 4; i++) {
    scanf("%d %d %d %d", &SX[i], &SY[i], &FX[i], &FY[i]);
    id[i] = i;
  }
  bool flag = 0;
  do {
    for (int i = 1; i <= 4; i++) {
      sx[i - 1] = SX[id[i]];
      fx[i - 1] = FX[id[i]];
      sy[i - 1] = SY[id[i]];
      fy[i - 1] = FY[id[i]];
    }
    for (int i = 0; i < 2; i++) {
      swap(sx[0], fx[0]);
      swap(sy[0], fy[0]);
      for (int j = 0; j < 2; j++) {
        swap(sx[1], fx[1]);
        swap(sy[1], fy[1]);
        for (int k = 0; k < 2; k++) {
          swap(sx[2], fx[2]);
          swap(sy[2], fy[2]);
          for (int l = 0; l < 2; l++) {
            swap(sx[3], fx[3]);
            swap(sy[3], fy[3]);
            if (sy[0] != fy[0]) continue;
            if (sx[1] != fx[1]) continue;
            if (sy[2] != fy[2]) continue;
            if (sx[3] != fx[3]) continue;
            if (fy[0] != sy[1] || fx[0] != sx[1]) continue;
            if (fy[1] != sy[2] || fx[1] != sx[2]) continue;
            if (fy[2] != sy[3] || fx[2] != sx[3]) continue;
            if (fy[3] != sy[0] || fx[3] != sx[0]) continue;
            if (sy[0] == sy[2]) continue;
            if (sx[0] == sx[2]) continue;
            flag = 1;
            goto lp;
          }
        }
      }
    }
  } while (next_permutation(id + 1, id + 5));
lp:
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
