#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  map<pair<int, int>, int> m;
  int x1, y1, x2, y2, yes1 = 0, yes2 = 0, cnt = 0;
  for (int i = 1; i <= 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2 && y1 != y2) yes1++;
    if (x1 != x2 && y1 == y2) yes2++;
    m[{x1, y1}]++, m[{x2, y2}]++;
    if (m[{x1, y1}] == 2) cnt++;
    if (m[{x2, y2}] == 2) cnt++;
  }
  if (yes1 == 2 && yes2 == 2 && cnt == 4 && m.size() == 4)
    cout << "YES";
  else
    cout << "NO";
}
