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