#include <bits/stdc++.h>
using namespace std;
struct line {
  long long x1, y1, x2, y2;
  line(long long x1, long long x2, long long x3, long long x4)
      : x1(x1), y1(x2), x2(x3), y2(x4) {}
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long p, q, r, s;
  vector<line> xwale, ywale;
  for (long long int i = 1; i <= 4; ++i) {
    cin >> p >> q >> r >> s;
    if (p == r) {
      xwale.emplace_back(p, q, r, s);
    } else if (q == s) {
      ywale.emplace_back(p, q, r, s);
    } else if (p == r && q == s) {
      cout << "NO" << endl;
      exit(0);
    } else {
      cout << "NO" << endl;
      exit(0);
    }
  }
  bool truth = 0;
  if (xwale.size() != 2 || ywale.size() != 2 || xwale[0].x1 == xwale[1].x1 ||
      ywale[0].y1 == ywale[1].y1) {
    cout << "NO" << endl;
    exit(0);
  } else {
    long long x1 = min(xwale[0].x1, xwale[1].x1);
    long long x2 = max(xwale[0].x1, xwale[1].x1);
    long long y1 = min(ywale[0].y1, ywale[1].y1);
    long long y2 = max(ywale[0].y1, ywale[1].y1);
    long long area = (x2 - x1) * (y2 - y1);
    long long p = abs(xwale[0].y1 - xwale[0].y2);
    long long q = abs(ywale[0].x1 - ywale[0].x2);
    long long areabig = p * q;
    if (area == areabig) {
      cout << "YES" << endl;
      exit(0);
    }
    cout << "NO" << endl;
  }
  return 0;
}
