#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-9;
const int INF = 0x7FFFFFFF;
const double PI = acos(-1.0);
int main() {
  set<pair<int, int> > s, s1;
  set<pair<pair<int, int>, pair<int, int> > > s2;
  int x1, y1, x2, y2, first, second;
  for (int(i) = 0; (i) < (int)(4); (i)++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    pair<int, int> p1 = make_pair(x1, y1), p2 = make_pair(x2, y2);
    if (p1 > p2) swap(p1, p2);
    s2.insert(make_pair(p1, p2));
    first = abs(x1 - x2);
    second = abs(y1 - y2);
    if ((first && second) || (!first && !second)) return puts("NO"), 0;
    s.insert(make_pair(first, second));
    s1.insert(make_pair(x1, y1));
    s1.insert(make_pair(x2, y2));
  }
  if (((int)(s).size()) == 2 && ((int)(s1).size()) == 4 &&
      ((int)(s2).size()) == 4)
    puts("YES");
  else
    puts("NO");
}
