#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
const long long int INF = 1e18;
const int N = 20;
void solve(int t) {
  long long int x1[4], x2[4], y1[4], y2[4];
  for (int i = 0; i < 4; i++) {
    cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
  }
  map<pair<long long int, long long int>, long long int> mp;
  for (int i = 0; i < 4; i++) {
    mp[{x1[i], y1[i]}]++;
    mp[{x2[i], y2[i]}]++;
  }
  if (mp.size() != 4) {
    cout << "NO"
         << "\n";
    return;
  }
  for (auto i : mp) {
    if (i.second != 2) {
      cout << "NO"
           << "\n";
      return;
    }
  }
  long long int a = 0;
  long long int b = 0;
  for (int i = 0; i < 4; i++) {
    if (x1[i] == x2[i] and y1[i] == y2[i]) {
      cout << "NO"
           << "\n";
      return;
    }
    if (x1[i] == x2[i]) a++;
    if (y1[i] == y2[i]) b++;
  }
  if (a != 2 or b != 2) {
    cout << "NO"
         << "\n";
    return;
  }
  cout << "YES"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
