#include <bits/stdc++.h>
using namespace std;
template <class T>
void out(T A[], int n) {
  cout << "{";
  for (int i = 0; i < n; i++) {
    cout << A[i];
    if (i == n - 1)
      cout << "}";
    else
      cout << ",";
  }
  cout << endl;
}
template <class T>
void out(T A[], int n, int m) {
  for (int i = 0; i < n; ++i) out(A[i], m);
  cout << endl;
}
template <class T>
void out(vector<T> A, int n = -1) {
  if (n < 0 || n > ((int)A.size())) n = ((int)A.size());
  cout << "{";
  for (int i = 0; i < n; i++) {
    cout << A[i];
    if (i == n - 1)
      cout << "}";
    else
      cout << ",";
  }
  cout << endl;
}
const int MAXN = 110;
const int INF = 1000000000;
const double EPS = 1e-8;
const double PI = acos(-1.0);
bool run() {
  int x1[4], y1[4], x2[4], y2[4];
  map<pair<int, int>, int> mp;
  bool flag = true;
  int ver = 0, hor = 0;
  for (int i = 0; i < 4; ++i) {
    scanf("%d %d %d %d", &x1[i], &y1[i], &x2[i], &y2[i]);
    pair<int, int> p1 = make_pair(x1[i], y1[i]);
    pair<int, int> p2 = make_pair(x2[i], y2[i]);
    mp[p1]++;
    mp[p2]++;
    if (x1[i] == x2[i] && y1[i] == y2[i]) flag = false;
    if (x1[i] != x2[i] && y1[i] != y2[i]) flag = false;
    if (x1[i] == x2[i] && y1[i] != y2[i]) ver++;
    if (x1[i] != x2[i] && y1[i] == y2[i]) hor++;
  }
  if (!flag) return false;
  if (mp.size() != 4) return false;
  for (map<pair<int, int>, int>::iterator it = mp.begin(); it != mp.end();
       ++it) {
    if (it->second != 2) return false;
  }
  if (hor != 2 || ver != 2) return false;
  return true;
}
int main() {
  if (run())
    puts("YES");
  else
    puts("NO");
  return 0;
}
