#include <bits/stdc++.h>
using namespace std;
pair<pair<int, int>, pair<int, int>> segment, p1, p2, p3, p4;
map<pair<pair<int, int>, pair<int, int>>, int> segmentExixt;
bool isRectangle(vector<pair<int, int>> A) {
  bool flag;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (i != j) {
        for (int k = 0; k < 4; k++)
          if (k != i && k != j) {
            for (int l = 0; l < 4; l++)
              if (l != i && l != j && l != k) {
                if (A[i].first == A[l].first && A[i].second == A[j].second &&
                    A[k].first == A[j].first && A[k].second == A[l].second) {
                  p1.first = A[i];
                  p1.second = A[j];
                  p2.first = A[j];
                  p2.second = A[k];
                  p3.first = A[k];
                  p3.second = A[l];
                  p4.first = A[l];
                  p4.second = A[i];
                  if (segmentExixt[p1] > 0 && segmentExixt[p2] > 0 &&
                      segmentExixt[p3] > 0 && segmentExixt[p4] > 0)
                    return true;
                }
              }
          }
      }
  return false;
}
int main() {
  map<pair<int, int>, int> counter;
  vector<pair<int, int>> input;
  pair<int, int> A, B, C, D;
  pair<int, int> x, y;
  map<pair<int, int>, int>::iterator it;
  for (int i = 0; i < 4; i++) {
    cin >> x.first >> x.second >> y.first >> y.second;
    counter[x]++;
    counter[y]++;
    segment.first = x;
    segment.second = y;
    segmentExixt[segment]++;
    segment.first = y;
    segment.second = x;
    segmentExixt[segment]++;
  }
  int l = counter.size();
  bool check = false;
  if (l == 4) {
    for (it = counter.begin(); it != counter.end(); it++) {
      if (it->second == 2)
        input.push_back(it->first);
      else {
        cout << "NO" << endl;
        return 0;
      }
    }
    check = isRectangle(input);
  }
  if (check)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
