#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<pair<int, int>, pair<int, int> > vertices[4];
  for (int i = 0; i < 4; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    vertices[i] = make_pair(make_pair(a, b), make_pair(c, d));
    if (vertices[i].first > vertices[i].second)
      swap(vertices[i].second, vertices[i].first);
  }
  sort(vertices, vertices + 4);
  if (vertices[0].first.first == vertices[1].first.first &&
      vertices[0].first.first == vertices[2].first.first &&
      vertices[0].first.first == vertices[0].second.first &&
      vertices[0].first.second == vertices[1].first.second &&
      vertices[0].first.second == vertices[3].first.second &&
      vertices[0].first.second == vertices[1].second.second &&
      vertices[3].first.first == vertices[1].second.first &&
      vertices[3].first.first == vertices[2].second.first &&
      vertices[3].first.first == vertices[3].second.first &&
      vertices[0].second.second == vertices[2].first.second &&
      vertices[0].second.second == vertices[2].second.second &&
      vertices[0].second.second == vertices[3].second.second &&
      vertices[0].second.first != vertices[1].second.first &&
      vertices[0].second.second != vertices[1].second.second) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
