#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
vector<pair<long long, pair<long long, long long> > > v, w;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 1; i <= 4; i++) {
    cin >> a >> b >> c >> d;
    if (a == c && b == d) {
      cout << "NO";
      return 0;
    } else if (a == c) {
      v.push_back({a, {min(b, d), max(b, d)}});
    } else if (b == d)
      w.push_back({b, {min(a, c), max(a, c)}});
  }
  if (v.size() == 2 && w.size() == 2 && v[0].first != v[1].first &&
      w[0].first != w[1].first) {
    sort(v.begin(), v.end());
    sort(w.begin(), w.end());
    for (long long i = 0; i <= 1; i++) {
      if (v[i].second.first != w[0].first or v[i].second.second != w[1].first) {
        cout << "NO";
        return 0;
      }
      if (w[i].second.first != v[0].first or w[i].second.second != v[1].first) {
        cout << "NO";
        return 0;
      }
    }
    cout << "YES";
  } else
    cout << "NO";
}
