#include <bits/stdc++.h>
using namespace std;
int main() {
  int hor = 0, ver = 0;
  set<pair<int, int> > points;
  for (int i = 0; i < 4; i++) {
    pair<int, int> a, b;
    cin >> a.first >> a.second >> b.first >> b.second;
    if (a.first == b.first) ver++;
    if (a.second == b.second) hor++;
    points.insert(a);
    points.insert(b);
  }
  bool b = false;
  if (points.size() == 4 && hor == 2 && ver == 2) {
    vector<pair<int, int> > a;
    for (set<pair<int, int> >::iterator it = points.begin(); it != points.end();
         it++) {
      a.push_back(*it);
    }
    if (a[0].first == a[1].first && a[2].first == a[3].first &&
        a[0].first < a[2].first && a[0].second == a[2].second &&
        a[1].second == a[3].second && a[0].second < a[1].second)
      b = true;
  }
  cout << (b ? "YES" : "NO") << endl;
}
