#include <bits/stdc++.h>
using namespace std;
int dcmp(double x) {
  if (fabs(x) < 1e-7) return 0;
  if (x < 0) return -1;
  return 1;
}
struct Seg {
  pair<long long, long long> a;
  pair<long long, long long> b;
} s[4];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  for (int i = 0; i < 4; ++i)
    cin >> s[i].a.first >> s[i].a.second >> s[i].b.first >> s[i].b.second;
  map<long long, int> MP;
  for (int i = 0; i < 4; ++i) {
    if (s[i].a.first != s[i].b.first && s[i].a.second != s[i].b.second) {
      cout << "NO";
      return 0;
    }
    long long len =
        abs(s[i].a.first - s[i].b.first) + abs(s[i].a.second - s[i].b.second);
    MP[len]++;
  }
  for (int i = 0; i < 4; ++i) {
    for (int j = i + 1; j < 4; ++j) {
      if (s[i].a.first == s[i].b.first && s[i].a.second == s[i].b.second) {
        cout << "NO";
        return 0;
      }
    }
  }
  if (MP.size() != 1 && MP.size() != 2)
    cout << "NO";
  else if (MP.size() == 1)
    cout << "YES";
  else if (MP.size() == 2) {
    auto it = MP.begin();
    if (it->second == 2)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
