#include <bits/stdc++.h>
using namespace std;
struct node {
  int x1, x2, y1, y2;
} heng[3], shu[3];
bool cmp1(node x, node y) { return x.x1 < y.x1; }
bool cmp2(node x, node y) { return x.y1 < y.y1; }
int main() {
  int x, y, z, w, h, s, ww;
  h = s = 0;
  for (int i = 1; i <= 4; i++) {
    scanf("%d%d%d%d", &x, &y, &z, &w);
    if (x == z) {
      if (y > w) swap(y, w);
      shu[++s].x1 = x;
      shu[s].y1 = y;
      shu[s].x2 = z;
      shu[s].y2 = w;
    } else if (y == w) {
      if (x > z) swap(x, z);
      heng[++h].x1 = x;
      heng[h].y1 = y;
      heng[h].x2 = z;
      heng[h].y2 = w;
    }
  }
  if (s != 2 || h != 2) {
    puts("NO");
    return 0;
  }
  sort(shu + 1, shu + 3, cmp1);
  sort(heng + 1, heng + 3, cmp2);
  if (shu[1].y1 == shu[2].y1 && shu[1].y2 == shu[2].y2 &&
      shu[1].y1 != shu[1].y2 && heng[1].x1 == heng[2].x1 &&
      heng[1].x2 == heng[2].x2 && heng[1].x1 != heng[1].x2 &&
      heng[1].x1 == shu[1].x1 && heng[1].y1 == shu[1].y1 &&
      heng[1].x2 == shu[2].x1 && heng[1].y2 == shu[2].y1 &&
      heng[2].x1 == shu[1].x2 && heng[2].y1 == shu[1].y2 &&
      heng[2].x2 == shu[2].x2 && heng[2].y2 == shu[2].y2)
    puts("YES");
  else
    puts("NO");
  return 0;
}
