#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x1, y1, x2, y2, i, c[16], j = 0;
  double m[4];
  set<long long> s;
  set<pair<long long, long long> > p;
  for (i = 0; i < 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    c[j] = x1;
    c[j + 1] = y1;
    c[j + 2] = x2;
    c[j + 3] = y2;
    j = j + 4;
    if (x2 == x1)
      m[i] = -1;
    else
      m[i] = (double)(y2 - y1) / (x2 - x1);
    s.insert(m[i]);
  }
  for (i = 0; i < 16; i = i + 2) {
    int count = 0;
    for (j = 0; j < 16; j = j + 2) {
      if (c[i] == c[j] && c[i + 1] == c[j + 1] && i != j) count++;
    }
    if (count != 1) {
      cout << "NO";
      return 0;
    }
  }
  if (s.size() != 2)
    cout << "NO";
  else {
    set<long long>::iterator it;
    i = 0;
    int x, y;
    for (it = s.begin(); it != s.end(); ++it) {
      if (i == 0)
        x = *it;
      else
        y = *it;
      i++;
    }
    if (x * y == 0 && (x == -1 || y == -1))
      cout << "YES";
    else
      cout << "NO";
  }
}
