#include <bits/stdc++.h>
using namespace std;
void gk() {}
int64_t mul(int64_t a, int64_t b) {
  return (a * b) % (int64_t)1000000007;
  ;
}
int64_t inv(int64_t a, int64_t b, int64_t &x, int64_t &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  int64_t x1, y1;
  int64_t g = inv(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
int64_t bexpo(int64_t a, int64_t n) {
  if (n <= 0) return 1;
  int64_t res = 1;
  while (n > 0) {
    if (n & 1) {
      res = (res * a) % 1000000007;
      ;
    }
    a = (a * a) % 1000000007;
    ;
    n >>= 1;
  }
  res %= 1000000007;
  ;
  return res;
}
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
const int64_t sz = 1e3 + 3;
const int64_t sz2 = 3e4 + 50;
int64_t row[4] = {0, 1, 0, -1};
int64_t col[4] = {1, 0, -1, 0};
int64_t n, m;
void find() {
  vector<array<int64_t, 4> > ar(4);
  map<array<int64_t, 2>, int64_t> mp;
  for (int64_t i = 0; i < 4; i++) {
    cin >> ar[i][0] >> ar[i][1] >> ar[i][2] >> ar[i][3];
    mp[{ar[i][0], ar[i][1]}]++;
    mp[{ar[i][2], ar[i][3]}]++;
  }
  if (mp.size() == 1 || mp.size() == 2 || mp.size() == 4) {
    set<array<int64_t, 2> > st;
    for (int64_t i = 0; i < 4; i++) {
      st.insert({ar[i][0], ar[i][1]});
      st.insert({ar[i][2], ar[i][3]});
    }
    vector<array<int64_t, 2> > aux;
    for (array<int64_t, 2> i : st) {
      aux.push_back({i[0], i[1]});
    }
    cout << "YES\n";
  } else {
    cout << "NO";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  std::cout.tie(0);
  int64_t t = 1;
  while (t--) {
    find();
  }
  return 0;
}
