#include <bits/stdc++.h>
using namespace std;
long long int x1, x2, y, y2, i, j, c = 0, co = 0, test = 0;
int main() {
  map<pair<long long int, long long int>, long long int> mp;
  pair<long long int, long long int> p1, p2;
  for (i = 1; i <= 4; i++) {
    cin >> x1 >> y >> x2 >> y2;
    if ((x1 - x2) != 0) c++;
    if ((y - y2) != 0) co++;
    p1 = make_pair(x1, y);
    p2 = make_pair(x2, y2);
    if (mp[p1] == 1) test++;
    if (mp[p2] == 1) test++;
    mp[p1]++;
    mp[p2]++;
  }
  if (test != 4 || c != 2 || co != 2)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
