#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> m;
map<pair<pair<int, int>, pair<int, int> >, int> m2;
int tot = 0;
int main() {
  for (int i = 1; i <= 4; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a != c || b != d) {
      cout << "NO";
      return 0;
    }
    if (m[make_pair(a, b)]) {
      tot++;
    }
    if (m[make_pair(c, d)]) {
      tot++;
    }
    if (m2[make_pair(make_pair(a, b), make_pair(c, d))]) {
      cout << "NO";
      return 0;
    }
    m2[make_pair(make_pair(a, b), make_pair(c, d))] =
        m2[make_pair(make_pair(c, d), make_pair(a, b))] = 1;
    m[make_pair(a, b)]++;
    m[make_pair(c, d)]++;
  }
  cout << (tot == 4 ? "YES" : "NO");
  return 0;
}
