#include <bits/stdc++.h>
using namespace std;
int tot, cntx, cnty, sum;
struct node {
  int x, y;
  bool used;
};
node a[10];
int main() {
  int x1, x2, y1, y2;
  for (int i = 1; i <= 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    a[++tot] = (node){x1, y1};
    a[++tot] = (node){x2, y2};
    if (x1 != x2 && y1 != y2) {
      cout << "NO" << endl;
      return 0;
    }
    if (x1 == x2) {
      ++cntx;
    }
    if (y1 == y2) {
      ++cnty;
    }
  }
  if (cntx != 2 || cnty != 2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= tot; i++) {
    int cnt = 0;
    if (a[i].used) {
      continue;
    }
    for (int j = i + 1; j <= tot; j++) {
      if (a[i].x == a[j].x && a[i].y == a[j].y) {
        ++cnt;
        a[j].used = true;
      }
    }
    if (cnt != 1) {
      cout << "NO" << endl;
      return 0;
    }
    ++sum;
  }
  if (sum == 4) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
