#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n = 4;
  vector<pair<int, int>> a, b;
  map<pair<int, int>, int> m;
  int x = 0, y = 0;
  for (int i = 0; i < 4; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    a.push_back({x1, y1});
    b.push_back({x2, y2});
    if (x1 != x2 && y1 != y2) {
      cout << "NO";
      return 0;
    }
    if (x1 == x2)
      x++;
    else
      y++;
    m[{x1, y1}]++;
    m[{x2, y2}]++;
  }
  if (x != 2 && y != 2) {
    cout << "NO";
    return 0;
  }
  if (m.size() == 4) {
    for (auto it = m.begin(); it != m.end(); it++) {
      if (it->second != 2) {
        cout << "NO";
        return 0;
      }
    }
    cout << "YES";
  } else
    cout << "NO";
}
