#include <bits/stdc++.h>
using namespace std;
vector<int> parents, ranks, emp[111];
int find_set(int x) {
  if (parents[x] == x) return x;
  return parents[x] = find_set(parents[x]);
}
bool Union(int x, int y) {
  x = find_set(x), y = find_set(y);
  if (x == y) return false;
  if (ranks[x] > ranks[y]) swap(x, y);
  parents[x] = y;
  if (ranks[x] == ranks[y]) ranks[y]++;
  return true;
}
int x1[5], x2[5], y[5], y2[5];
map<pair<int, int>, int> x;
map<pair<pair<pair<int, int>, int>, int>, int> m;
int arr[5];
int main() {
  int j = 0;
  for (int i = 0; i < 4; ++i) {
    cin >> x1[i] >> y[i] >> x2[i] >> y2[i];
    x[make_pair(x1[i], y[i])]++;
    x[make_pair(x2[i], y2[i])]++;
    if (!m[make_pair(make_pair(make_pair(x2[i], y2[i]), y[i]), x1[i])]) j++;
    m[make_pair(make_pair(make_pair(x2[i], y2[i]), y[i]), x1[i])] = 1;
    m[make_pair(make_pair(make_pair(x1[i], y[i]), y2[i]), x2[i])] = 1;
  }
  bool flag = true;
  for (int i = 0; i < 4; ++i) {
    if (x[make_pair(x1[i], y[i])] != 2 || x[make_pair(x2[i], y2[i])] != 2)
      flag = false;
    if (x1[i] != x2[i] && y[i] != y2[i]) flag = false;
  }
  if (j != 4) {
    flag = false;
  }
  cout << (flag ? "YES" : "NO");
}
