#include <bits/stdc++.h>
using namespace std;
const int N = 112345;
int x1[N], Y1[N], x2[N], y2[N];
int main() {
  int n, m, i, j, x;
  n = 4;
  map<pair<int, int>, int> mp;
  for (i = 1; i <= n; i++) cin >> x1[i] >> Y1[i] >> x2[i] >> y2[i];
  for (i = 1; i <= n; i++) {
    if (x1[i] == x2[i] && Y1[i] == y2[i]) {
      puts("NO");
      return 0;
    }
    if (x1[i] != x2[i] && Y1[i] != y2[i]) {
      puts("NO");
      return 0;
    }
    int t = 0;
    if (x1[i] == x2[i]) t ^= 1;
    if (Y1[i] == y2[i]) t ^= 2;
    mp[(make_pair(x1[i], Y1[i]))] ^= t;
    mp[(make_pair(x2[i], y2[i]))] ^= t;
  }
  if (mp.size() != 4) {
    puts("NO");
    return 0;
  }
  for (map<pair<int, int>, int>::iterator i = mp.begin(); i != mp.end(); i++) {
    if ((*i).second != 3) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
}
