#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int x1, y1, x2, y2, i, a = 0, b = 0, m = 0, k = 0;
  map<pair<long long int, long long int>, long long int> P;
  for (i = 0; i < 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 != x2 and y1 == y2) {
      a++;
    }
    if (x1 == x2 and y1 != y2) {
      b++;
    }
    P[make_pair(x1, y1)]++;
    P[make_pair(x2, y2)]++;
  }
  for (auto i : P) {
    if (i.second != 2) {
      m = 1;
    }
    k++;
  }
  if (m == 0 and k == 4) {
    if (a == 2 and b == 2) {
      cout << "YES";
      return 0;
    }
    cout << "NO";
    return 0;
  }
  cout << "NO";
}
