#include <bits/stdc++.h>
using namespace std;
struct my_comp {
  bool operator()(const pair<long long, long long> &p1,
                  const pair<long long, long long> &p2) {
    return (p1.first < p2.first) ||
           (p1.first == p2.first && p1.second < p2.second);
  }
};
int32_t main() {
  bool ok = true;
  vector<pair<long long, long long>> v;
  set<pair<long long, long long>, my_comp> second;
  long long xorsame = 0, yorsame = 0;
  for (long long i = 0; i < 4; i++) {
    long long a, b, x, y;
    cin >> a >> b >> x >> y;
    if (abs(a - x) != 0 && abs(b - y) != 0) ok &= false;
    if (x == a) xorsame++;
    if (y == b) yorsame++;
    second.insert({a, b});
    second.insert({x, y});
  }
  if (second.size() != 4 || xorsame != 2 || yorsame != 2)
    ok &= false;
  else {
    for (auto p : second) v.push_back({p.first, p.second});
    if (v[0].first != v[1].first || v[2].first != v[3].first ||
        v[0].second != v[2].second || v[1].second != v[3].second)
      ok &= false;
  }
  if (!ok)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
