#include <bits/stdc++.h>
using namespace std;
const double eps = 1E-8;
const int dx4[4] = {1, 0, 0, -1};
const int dy4[4] = {0, -1, 1, 0};
const int inf = 0x3f3f3f3f;
int a, b, c, d;
int l[10];
int cnt;
struct point {
  int x, y;
  bool operator<(point p) const {
    if (x < p.x) return true;
    if (x == p.x && y < p.y) return true;
    return false;
  }
  bool ok(point p) {
    if (x != p.x && y != p.y) return false;
    if (x == p.x && y == p.y) return false;
    if (x == p.x) cnt++;
    return true;
  }
  bool operator==(point p) const { return x == p.x && y == p.y; }
} p[10];
int main() {
  bool ok = true;
  cnt = 0;
  for (int i = 0; i < 4; i++) {
    cin >> p[i].x >> p[i].y >> p[i + 4].x >> p[i + 4].y;
    if (!p[i].ok(p[i + 4])) {
      ok = false;
    }
  }
  if (!ok || cnt != 2) {
    puts("NO");
  } else {
    sort(p, p + 8);
    if (p[0] == p[1] && p[2] == p[3] && p[4] == p[5] && p[6] == p[7]) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
  return 0;
}
