#include <bits/stdc++.h>
using namespace std;
string s;
int n, q;
int arr[4][4], a, b;
map<pair<int, int>, int> m;
int main() {
  bool bo = true;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      cin >> arr[i][j];
      if (j % 2) m[make_pair(arr[i][j - 1], arr[i][j])]++;
    }
    if (arr[i][0] == arr[i][2] && arr[i][1] == arr[i][3]) bo = false;
  }
  set<int> s;
  for (int i = 0; i < 4; i++)
    if (arr[i][1] == arr[i][3]) s.insert(i);
  if (s.size() != 2)
    bo = false;
  else {
    set<int>::iterator it = s.begin();
    a = arr[*it][1];
    it++;
    b = arr[*it][3];
    if (a == b) bo = false;
    s.clear();
  }
  for (int i = 0; i < 4; i++)
    if (arr[i][0] == arr[i][2]) s.insert(i);
  if (s.size() != 2)
    bo = false;
  else {
    set<int>::iterator it = s.begin();
    a = arr[*it][0];
    it++;
    b = arr[*it][2];
    if (a == b) b = false;
  }
  if (bo && m.size() == 4)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
