#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= 2; j++) {
      int x, y;
      cin >> x >> y;
      cnt[{x, y}]++;
    }
  }
  bool good = 1;
  for (auto i : cnt) {
    if (i.second != 2) good = 0;
  }
  cout << (good ? "YES" : "NO") << '\n';
  return 0;
}
