#include <bits/stdc++.h>
using namespace std;
void NO() {
  puts("NO");
  exit(0);
}
void YES() {
  puts("YES");
  exit(0);
}
int main() {
  map<pair<int, int>, int> Mp;
  map<int, int> Mx, My;
  map<pair<pair<int, int>, pair<int, int> >, int> M;
  for (int i = (0); i < (4); i++) {
    pair<int, int> s, t;
    scanf("%d%d%d%d", &s.first, &s.second, &t.first, &t.second);
    if (s == t) NO();
    Mp[s]++;
    Mp[t]++;
    Mx[s.first]++;
    My[s.second]++;
    Mx[t.first]++;
    My[t.second]++;
    if (s > t) swap(s, t);
    M[make_pair(s, t)]++;
  }
  for (map<pair<int, int>, int>::iterator it = Mp.begin(); it != Mp.end(); it++)
    if (it->second != 2) NO();
  for (map<int, int>::iterator it = Mx.begin(); it != Mx.end(); it++)
    if (it->second != 4) NO();
  for (map<int, int>::iterator it = My.begin(); it != My.end(); it++)
    if (it->second != 4) NO();
  for (map<pair<pair<int, int>, pair<int, int> >, int>::iterator it = M.begin();
       it != M.end(); it++)
    if (it->second != 1) NO();
  YES();
}
