#include <bits/stdc++.h>
using namespace std;
vector<int> phi;
vector<int> spf;
void banao(int n) {
  phi.resize(n + 1);
  for (int i = 0; i < n + 1; i++) phi[i] = i;
  for (int k = 2; k < n + 1; k++) {
    if (phi[k] == k) {
      phi[k] = k - 1;
      for (int i = 2 * k; i <= n; i += k) {
        phi[i] = (phi[i] / k) * (k - 1);
      }
    }
  }
}
bool isprime(int n) {
  if (phi[n] == n - 1)
    return true;
  else
    return false;
}
void pfactor(int n) {
  spf.resize(n + 1, 1);
  for (int i = 2; i < n + 1; i++) spf[i] = i;
  for (int i = 4; i <= n; i += 2) spf[i] = 2;
  for (int i = 3; i * i <= n; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j <= n; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
vector<int> tpf(int x) {
  vector<int> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
struct e {
  int x, y, z, w;
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  int Test = 1;
  while (Test--) {
    map<pair<int, int>, int> m;
    int px = 0;
    for (int i = 0; i < 4; i++) {
      e ed;
      cin >> ed.x >> ed.y >> ed.z >> ed.w;
      if (ed.y == ed.w) {
        px++;
        if (ed.x == ed.z) {
          px = 4;
        }
      }
      if (ed.x != ed.z && ed.y != ed.w) {
        px = 4;
      }
      m[{ed.x, ed.y}]++;
      m[{ed.z, ed.w}]++;
    }
    vector<pair<int, int> > a;
    for (auto i : m) {
      if (i.second != 2) {
        cout << "NO";
        return 0;
      }
      a.push_back(i.first);
    }
    bool ok = ((a[0].first == a[1].first) && a[2].first == a[3].first);
    ok = (ok) && ((a[0].second == a[2].second) && (a[1].second == a[3].second));
    if (ok && px == 2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
