#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > v(4, vector<int>(4));
bool parallelToAxesCheck() {
  int hor = 0, ver = 0;
  for (int i = 0; i < 4; i++) {
    if (abs(v[i][0] - v[i][2]) == 0)
      ver++;
    else if (abs(v[i][1] - v[i][3]) == 0)
      hor++;
  }
  if (ver == 2 && hor == 2)
    return true;
  else
    return false;
}
bool rectCheck() {
  bool ch1, ch2;
  for (int i = 0; i < 4; i++) {
    if (v[i][0] == v[i][2] && v[i][1] == v[i][3]) return false;
    ch1 = 0;
    ch2 = 0;
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      if ((v[i][0] == v[j][0] && v[i][1] == v[j][1]) ||
          (v[i][0] == v[j][2] && v[i][1] == v[j][3]))
        ch1 = 1;
      if ((v[i][2] == v[j][0] && v[i][3] == v[j][1]) ||
          (v[i][2] == v[j][2] && v[i][3] == v[j][3]))
        ch2 = 1;
    }
    if (!ch1 || !ch2) return false;
  }
  return true;
}
int main() {
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      scanf("%d", &v[i][j]);
    }
  }
  if (parallelToAxesCheck() && rectCheck())
    printf("YES");
  else
    printf("NO");
}
