#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x1, y1, x2, y2;
  map<pair<long long int, long long int>, int> m;
  int test = 0;
  int hor = 0;
  int ver = 0;
  for (int i = 0; i < 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if ((y2 - y1) != 0) {
      ver++;
    }
    if ((x2 - x1) != 0) {
      hor++;
    }
    pair<long long int, long long int> p1 = make_pair(x1, y1);
    pair<long long int, long long int> p2 = make_pair(x2, y2);
    if (m[p1] == 1) {
      test++;
    }
    if (m[p2] == 1) {
      test++;
    }
    m[p1]++;
    m[p2]++;
  }
  if (test != 4 || ver != 2 || hor != 2) {
    cout << "NO";
  } else {
    cout << "YES";
  }
  return 0;
}
