#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17 + 7;
const long long MOD = 1e7 + 9;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  map<pair<long long, long long>, long long> ed;
  set<set<pair<long long, long long>>> pairs;
  map<long long, long long> dist;
  for (long long i = 0; i < 4; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if ((a != c && b != d) || (a == c && b == d)) {
      cout << "NO"
           << "\n";
      return 0;
    }
    dist[pow((a - c), 2) + pow((b - d), 2)]++;
    set<pair<long long, long long>> temp;
    temp.insert({a, b});
    temp.insert({c, d});
    pairs.insert(temp);
    ed[{a, b}]++;
    ed[{c, d}]++;
  }
  for (auto it = ed.begin(); it != ed.end(); it++) {
    if (it->second != 2) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  if (pairs.size() != 4) {
    cout << "NO"
         << "\n";
    return 0;
  }
  if (dist.begin()->second == 4 ||
      (dist.begin()->second == 2 && dist.rbegin()->second == 2)) {
    cout << "YES"
         << "\n";
    return 0;
  }
  cout << "NO"
       << "\n";
  return 0;
}
