#include <bits/stdc++.h>
using namespace std;
struct seg {
  int x1, y1;
  int x2, y2;
  friend bool operator*(seg &a, seg &b) {
    return a.x1 == b.x1 && a.x2 == b.x2 && a.y1 == b.y1 && a.y2 == b.y2;
  }
} p[4];
int main() {
  while (~scanf("%d%d%d%d", &p[0].x1, &p[0].y1, &p[0].x2, &p[0].y2)) {
    bool l = 0;
    for (int i = 1; i < 4; i++) {
      scanf("%d%d%d%d", &p[i].x1, &p[i].y1, &p[i].x2, &p[i].y2);
      if (p[i].x1 == p[i].x2 && p[i].y1 == p[i].y2) l = 1;
    }
    if (l) {
      puts("NO");
      continue;
    }
    for (int i = 0; i < 4; i++)
      for (int j = i + 1; j < 4; j++)
        if (p[i] * p[j]) l = 1;
    if (l) {
      puts("NO");
      continue;
    }
    int cnt1 = 0, cnt2 = 0;
    seg x[4], y[4];
    for (int i = 0; i < 4; i++) {
      if (p[i].x1 == p[i].x2) x[cnt1++] = p[i];
      if (p[i].y1 == p[i].y2) y[cnt2++] = p[i];
    }
    if (cnt1 < 2 || cnt2 < 2) {
      puts("NO");
      continue;
    }
    int point = 0;
    set<pair<int, int> > mp;
    mp.clear();
    for (int i = 0; i < 4; i++)
      mp.insert(make_pair(p[i].x1, p[i].y1)),
          mp.insert(make_pair(p[i].x2, p[i].y2));
    point = mp.size();
    if (point != 4)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
