#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double PI = acos(-1);
const double EPS = 1e-8;
struct L {
  int x1, y1, x2, y2;
};
L l[4];
bool solve() {
  int a = 0, b = 0;
  for (int i = 0; i < (int)4; ++i) {
    bool f1 = 0, f2 = 0;
    if (l[i].x1 == l[i].x2) f1 = 1;
    if (l[i].y1 == l[i].y2) f2 = 1;
    if (f1 && f2) return 0;
    if (f1) a++;
    if (f2) b++;
  }
  if (a != 2 || b != 2) return 0;
  set<pair<int, int> > se;
  for (int i = 0; i < (int)4; ++i) {
    se.insert(pair<int, int>(l[i].x1, l[i].y1));
    se.insert(pair<int, int>(l[i].x2, l[i].y2));
  }
  if (se.size() != 4) return 0;
  string s = "0123";
  L t[4];
  do {
    for (int S = 0; S < (int)1 << 4; ++S) {
      for (int i = 0; i < (int)4; ++i) {
        t[i] = l[s[i] - '0'];
        if (S >> i & 1) {
          swap(t[i].x1, t[i].x2);
          swap(t[i].y1, t[i].y2);
        }
      }
      bool f = 1;
      for (int i = 0; i < (int)4; ++i) {
        if (t[i].x2 == t[(i + 1) % 4].x1 && t[i].y2 == t[(i + 1) % 4].y1)
          ;
        else
          f = 0;
      }
      if (f) return 1;
    }
  } while (next_permutation((s).begin(), (s).end()));
  return 0;
}
int main() {
  for (int i = 0; i < (int)4; ++i) {
    cin >> l[i].x1 >> l[i].y1 >> l[i].x2 >> l[i].y2;
  }
  cout << (solve() ? "YES" : "NO") << endl;
}
