#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807;
void doh() {
  cout << "NO" << endl;
  exit(0);
}
int main() {
  pair<int, int> l[15], r[15];
  pair<int, int> a[20];
  int cur = 0;
  for (int i = 0; i < 4; ++i) {
    int curx, cury;
    cin >> curx >> cury;
    l[i].first = curx;
    l[i].second = cury;
    a[cur++] = make_pair(curx, cury);
    cin >> curx >> cury;
    r[i].first = curx;
    r[i].second = cury;
    a[cur++] = make_pair(curx, cury);
    if (l[i] == r[i]) doh();
  }
  sort(a, a + cur);
  cur = unique(a, a + cur) - a;
  if (cur != 4) doh();
  if (!(a[0].second == a[2].second && a[1].second == a[3].second &&
        a[0].first == a[1].first && a[2].first == a[3].first))
    doh();
  bool con[10][10] = {0};
  for (int i = 0; i < 4; ++i) {
    int fi = -1, si = -1;
    for (int j = 0; j < 4; ++j) {
      if (a[j] == l[i]) fi = j;
      if (a[j] == r[i]) si = j;
    }
    con[fi][si] = true;
    con[si][fi] = true;
  }
  if (!(con[0][1] && con[1][3] && con[3][2] && con[2][0])) doh();
  cout << "YES" << endl;
  return 0;
}
