#include <bits/stdc++.h>
using namespace std;
int vec[10][2];
int main() {
  map<pair<int, int>, int> point;
  for (int i = 0; i < 4; i++) {
    int a, b, c, d;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    vec[i][0] = a - c;
    vec[i][1] = b - d;
    point[make_pair(a, b)] += 1;
    point[make_pair(c, d)] += 1;
  }
  bool flag = (point.size() == 4) ? 1 : 0;
  for (int i = 0; i < 4; i++)
    if (vec[i][1] != 0 && vec[i][0] != 0) flag = 0;
  map<pair<int, int>, int>::iterator iter;
  if (!flag) {
    cout << "NO" << endl;
    return 0;
  }
  for (iter = point.begin(); iter != point.end(); iter++)
    if (iter->second != 2) flag = 0;
  if (!flag) {
    cout << "NO" << endl;
    return 0;
  }
  int hor = 0, par = 0;
  for (int i = 1; i < 4; i++) {
    int tmp = vec[0][0] * vec[i][0] + vec[0][1] * vec[i][1];
    if (tmp == 0) hor++;
    tmp = vec[0][0] * vec[i][1] - vec[0][1] * vec[i][0];
    if (tmp == 0) par++;
  }
  if (par == 1 && hor == 2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
