#include <bits/stdc++.h>
using namespace std;
const double Pi = acos(-1.0);
int main() {
  if (fopen("data.in", "r")) freopen("data.in", "r", stdin);
  bool isRect = true;
  map<pair<int, int>, int> cnt;
  map<int, int> x, y;
  for (int i = 0; i < 4; i++) {
    pair<int, int> a, b;
    scanf("%d%d", &a.first, &a.second);
    scanf("%d%d", &b.first, &b.second);
    isRect &= (a != b);
    isRect &= (a.first == b.first) || (a.second == b.second);
    x[a.first]++, x[b.first]++;
    y[a.second]++, y[b.second]++;
    cnt[a] += 1, cnt[b] += 1;
  }
  for (map<pair<int, int>, int>::iterator it = cnt.begin(); it != cnt.end();
       it++)
    isRect &= it->second == 2;
  for (map<int, int>::iterator it = x.begin(); it != x.end(); it++)
    isRect &= it->second == 2;
  for (map<int, int>::iterator it = y.begin(); it != y.end(); it++)
    isRect &= it->second == 2;
  if (isRect)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
