#include <bits/stdc++.h>
using namespace std;
int X1[4], Y1[4], X2[4], Y2[4];
int main() {
  int Q[4];
  for (int i = 0; i < 4; i++) Q[i] = i;
  for (int i = 0; i < 4; i++) {
    cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
    if (Y1[i] == Y2[i] && X1[i] > X2[i]) swap(X1[i], X2[i]);
    if (X1[i] == X2[i] && Y1[i] > Y2[i]) swap(Y1[i], Y2[i]);
  }
  bool res = false;
  do {
    if ((Y1[Q[0]] == Y1[Q[2]]) && (X1[Q[0]] == X2[Q[0]]) &&
        (X1[Q[2]] == X2[Q[2]]) && (Y2[Q[0]] == Y2[Q[2]])) {
      if ((X1[Q[1]] == X1[Q[3]]) && (X2[Q[1]] == X2[Q[3]]) &&
          (Y1[Q[1]] == Y2[Q[1]]) && (Y1[Q[3]] == Y2[Q[3]]))
        res = true;
    }
  } while (next_permutation(Q, Q + 4));
  if (res)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  cin >> Q[0];
  return 0;
}
