#include <bits/stdc++.h>
using namespace std;
template <class T>
string tostring(T x) {
  ostringstream out;
  out << x;
  return out.str();
}
long long toint(string s) {
  istringstream in(s);
  long long x;
  in >> x;
  return x;
}
int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, -1, 1, -1, 1};
int kx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
int ky[8] = {2, -2, 2, -2, 1, -1, 1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  pair<int, int> A[4], B[4];
  for (int i = 0; i < 4; i++) {
    cin >> A[i].first >> A[i].second >> B[i].first >> B[i].second;
    if (A[i].first != B[i].first and A[i].second != B[i].second) {
      cout << "NO"
           << "\n";
      return 0;
    }
  }
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (j == i) continue;
      if (B[i] != A[j] and B[i] != B[j]) continue;
      if (B[i] == B[j]) swap(A[j], B[j]);
      for (int k = 0; k < 4; k++) {
        if (k == j or k == i) continue;
        if (B[j] != A[k] and B[j] != B[k]) continue;
        if (B[j] == B[k]) swap(A[k], B[k]);
        for (int l = 0; l < 4; l++) {
          if (l == k or l == j or l == i) continue;
          if (B[k] != A[l] and B[k] != B[l]) continue;
          if (B[k] == B[l]) swap(A[l], B[l]);
          if (B[l] != A[i]) continue;
          int x, y;
          if (A[i].second == B[i].second) {
            x = abs(A[i].first - B[i].first);
            y = abs(A[j].second - B[j].second);
          } else {
            x = abs(A[j].first - B[j].first);
            y = abs(A[i].second - B[i].second);
          }
          if (x > 0 and y > 0 and A[i] != A[k] and A[j] != A[l]) {
            cout << "YES"
                 << "\n";
            return 0;
          }
        }
      }
    }
  cout << "NO"
       << "\n";
  return 0;
}
