#include <bits/stdc++.h>
using namespace std;
int x[109], y[109];
int main() {
  int x1, y1, x2, y2, i, j, tmp = 0, tmp0 = 0, tmp1 = 0;
  pair<int, int> A[5], B[5];
  for (int i = 0; i < 4; i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    x[i] = x2 - x1;
    y[i] = y2 - y1;
    A[i] = pair<int, int>(x1, y1);
    B[i] = pair<int, int>(x2, y2);
    if (y[i] == 0 || x[i] == 0) tmp0++;
  }
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      if (i != j && (x[i] * x[j] + y[i] * y[j] != 0)) tmp++;
      if (i != j && (A[i] == A[j] || A[i] == B[j])) tmp1++;
    }
  if (tmp0 == 4 && tmp == 4 && tmp1 == 4)
    cout << "YES";
  else
    cout << "NO";
}
