#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, minix = LONG_LONG_MAX, maxix = LONG_LONG_MIN,
               miniy = LONG_LONG_MAX, maxiy = LONG_LONG_MIN;
  set<long long> s;
  map<pair<long long, long long>, long long> m;
  for (i = 0; i < 4; i++) {
    long long x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    m[make_pair(x1, y1)]++;
    m[make_pair(x2, y2)]++;
    maxix = max(maxix, max(x1, x2));
    maxiy = max(maxiy, max(y1, y2));
    minix = min(minix, min(x1, x2));
    miniy = min(miniy, min(y1, y2));
  }
  if (m.size() != 4) {
    cout << "NO";
    return 0;
  }
  if (m[make_pair(maxix, maxiy)] == 0 || m[make_pair(maxix, miniy)] == 0 ||
      m[make_pair(minix, maxiy)] == 0 || m[make_pair(minix, miniy)] == 0) {
    cout << "NO";
    return 0;
  }
  map<pair<long long, long long>, long long>::iterator it;
  cout << "YES";
}
