#include <bits/stdc++.h>
using namespace std;
bool isprime(long long a) {
  for (long long i = 2; i <= sqrt(a); i++) {
    if (a % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / (gcd(a, b)); }
long long fact(long long n) {
  long long s = 1;
  for (long long i = 1, s = 1; i <= n; i++) {
    s *= i;
    if (i == n) return s;
  }
  return 1;
}
string itos(long long num) {
  ostringstream str1;
  str1 << num;
  string geek = str1.str();
  return geek;
}
long long comb(long long a, long long b) {
  long long mi = min(b, a - b);
  long long ma = max(b, a - b);
  long long s = 1;
  for (long long i = a; i > ma; i--) {
    s *= i;
    cout << i << " ";
  }
  cout << endl;
  return s / fact(mi);
}
long long mi = INT_MAX;
long long ma = 0;
void dfs(long long a, long long vis[], vector<long long> adj[]) {
  mi = min(mi, a);
  ma = max(ma, a);
  vis[a] = 1;
  for (long long x : adj[a]) {
    if (!vis[x]) {
      dfs(x, vis, adj);
    }
  }
}
bool safe(long long x, long long y, long long n, long long m) {
  return (x >= 0 && x < n && y >= 0 && y < m);
}
long long dx[] = {0, 0, 1, -1};
long long dy[] = {1, -1, 0, 0};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  map<pair<long long, long long>, vector<pair<long long, long long>>> m;
  map<long long, long long> f;
  map<pair<pair<long long, long long>, pair<long long, long long>>, long long>
      ma;
  long long i, j;
  long long x, y, x0, y0;
  for (i = 0; i < 4; i++) {
    cin >> x >> y >> x0 >> y0;
    if (ma[{{x, y}, {x0, y0}}] == 0 && ma[{{x0, y0}, {x, y}}] == 0) {
      ma[{{x, y}, {x0, y0}}]++;
      m[{x, y}].push_back({x0, y0});
      m[{x0, y0}].push_back({x, y});
    } else {
      cout << "NO" << endl;
      return 0;
    }
    if (x != x0 && y != y0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (m.size() > 4) {
    cout << "NO" << endl;
  } else {
    for (auto it : m) {
      for (auto iter : it.second) {
        long long q = it.first.first - iter.first;
        long long w = it.first.second - iter.second;
        q = q * q;
        w = w * w;
        f[q + w]++;
      }
    }
    if ((f.size() == 2 && (*f.begin()).second == 2 &&
         (*f.rbegin()).second == 2))
      cout << "YES" << endl;
    else if (f.size() == 1 && (*f.begin()).second == 4)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
