#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const long long INF = 1e9;
inline long long pwr(long long base, long long n, long long m) {
  long long ans = 1;
  while (n > 0) {
    if (n % 2 == 1) ans = (ans * base) % m;
    base = (base * base) % m;
    n /= 2;
  }
  return ans;
}
struct line {
  int x, y, a, b;
} l[4];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int i = 0; i < 4; i++) cin >> l[i].x >> l[i].y >> l[i].a >> l[i].b;
  for (int i = 0; i < 4; i++) {
    if (l[i].x != l[i].a && l[i].y != l[i].b) {
      cout << "NO";
      return 0;
    } else if (l[i].x == l[i].a && l[i].y == l[i].b) {
      cout << "NO";
      return 0;
    }
    if (l[i].x > l[i].a) {
      swap(l[i].x, l[i].a);
    } else if (l[i].y > l[i].b) {
      swap(l[i].y, l[i].b);
    }
  }
  vector<pair<int, pair<int, int> > > hori, verti;
  for (int i = 0; i < 4; i++) {
    if (l[i].x == l[i].a)
      verti.push_back(make_pair(l[i].x, make_pair(l[i].y, l[i].b)));
    else if (l[i].y == l[i].b)
      hori.push_back(make_pair(l[i].y, make_pair(l[i].x, l[i].a)));
  }
  if (hori.size() != 2 || verti.size() != 2) {
    cout << "NO";
    return 0;
  }
  if (hori[0].second.second - hori[0].second.first !=
      hori[1].second.second - hori[1].second.first) {
    cout << "NO";
    return 0;
  }
  if (verti[0].second.second - verti[0].second.first !=
      verti[1].second.second - verti[1].second.first) {
    cout << "NO";
    return 0;
  }
  if (hori[0].first > hori[1].first) swap(hori[0], hori[1]);
  if (verti[0].first > verti[1].first) swap(verti[0], verti[1]);
  if (hori[0].second.first == verti[0].first &&
      hori[0].second.second == verti[1].first) {
    if (hori[1].second.first == verti[0].first &&
        hori[1].second.second == verti[1].first)
      cout << "YES";
    else
      cout << "NO";
  } else {
    cout << "NO";
  }
  return 0;
}
