#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
struct point {
  int x, y;
  bool operator<(const point& a) const {
    if (y != a.y) return y < a.y;
    return x < a.x;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  set<point> P;
  int hor = 0, ver = 0;
  for (int i = (0); i < 4; i++) {
    point a, b;
    cin >> a.x >> a.y >> b.x >> b.y;
    hor += (a.y == b.y);
    ver += (a.x == b.x);
    P.insert(a);
    P.insert(b);
  }
  if (P.size() != 4 || hor != 2 || ver != 2)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
