#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  set<pair<int, int> > st;
  set<pair<pair<int, int>, pair<int, int> > > st1;
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < 4; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) cnt1++;
    if (y1 == y2) cnt2++;
    st.insert(pair<int, int>(x1, y1));
    st.insert(pair<int, int>(x2, y2));
    st1.insert(pair<pair<int, int>, pair<int, int> >(pair<int, int>(x1, y1),
                                                     pair<int, int>(x2, y2)));
    st1.insert(pair<pair<int, int>, pair<int, int> >(pair<int, int>(x2, y2),
                                                     pair<int, int>(x1, y1)));
  }
  if (cnt1 == cnt2 && cnt1 == 2 && st.size() == 4 && st1.size() == 8)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
