#include <bits/stdc++.h>
using namespace std;
int Ox, Oy, P, s;
long long a1, b1, a2, b2;
int NizRazl[4];
set<pair<pair<long long, long long>, pair<long long, long long> > > S2;
struct Tacka {
  long long x;
  long long y;
};
set<pair<long long, long long> > S;
int main() {
  for (int i = 0; i < 4; i++) {
    scanf("%I64d %I64d %I64d %I64d", &a1, &b1, &a2, &b2);
    if (a1 == a2 && b1 == b2)
      P = 1;
    else {
      if (b1 == b2)
        Oy++;
      else {
        if (a1 == a1)
          Ox++;
        else
          P = 1;
      }
    }
    S.insert(make_pair(a1, b1));
    S.insert(make_pair(a2, b2));
    S2.insert(make_pair(make_pair(a1, b1), make_pair(a2, b2)));
    NizRazl[i] = S2.size();
    if (i != 0)
      if (NizRazl[i] == NizRazl[i - 1]) P = 1;
  }
  if (S.size() != 4 || P) {
    printf("NO");
    return 0;
  }
  if (Ox == 2 && Oy == 2)
    printf("YES");
  else
    printf("NO");
  return 0;
}
