#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "{" << p.first << "," << p.second << "}";
  return os;
}
const int N = 3e5 + 5;
const int oo = 1e9 + 7;
vector<pair<pair<int, int>, int> > X, Y;
pair<int, int> operator+(pair<int, int> x, pair<int, int> y) {
  return {x.first + y.first, x.second + y.second};
}
bool pos() {
  for (int i = 0; i < 4; i++) {
    pair<int, int> a, b;
    cin >> a.first >> a.second;
    cin >> b.first >> b.second;
    if (a == b) return 0;
    if (a.first == b.first) {
      if (b < a) swap(a, b);
      Y.push_back({a, b.second - a.second});
    } else if (a.second == b.second) {
      if (b < a) swap(a, b);
      X.push_back({a, b.first - a.first});
    } else
      return 0;
  }
  if (X.size() != 2) return 0;
  if (Y.size() != 2) return 0;
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  if (X[0].second != X[1].second or X[0].first.first != X[1].first.first)
    return 0;
  if (Y[0].second != Y[1].second or Y[0].first.second != Y[1].first.second)
    return 0;
  if (X[0].first != Y[0].first) return 0;
  if (X[0].first + make_pair(0, Y[0].second) != X[1].first) return 0;
  if (Y[0].first + make_pair(X[0].second, 0) != Y[1].first) return 0;
  return 1;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << (pos() ? "YES\n" : "NO\n");
}
