#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, int> > nach(4);
  vector<pair<int, int> > kon(4);
  set<pair<int, int> > s;
  int px = 0, py = 0;
  for (int i(0); i < 4; i++) {
    cin >> nach[i].first >> nach[i].second >> kon[i].first >> kon[i].second;
    s.insert(nach[i]);
    s.insert(kon[i]);
  }
  if (s.size() == 4) {
    for (int i(0); i < 4; i++) {
      if (nach[i].first == kon[i].first) px++;
      if (nach[i].second == kon[i].second) py++;
    }
    if (px == 2 && py == 2)
      cout << "YES";
    else
      cout << "NO";
  } else
    cout << "NO";
}
