#include <bits/stdc++.h>
using namespace std;
int arr[4][4];
int slope[4][3];
int solve() {
  int found = 0, hor = 0, ver = 0;
  for (int i = 0; i < 4 && !found; i++) {
    slope[i][0] = abs(arr[i][2] - arr[i][0]);
    slope[i][1] = abs(arr[i][3] - arr[i][1]);
    slope[i][2] = max(slope[i][0], slope[i][1]);
    if (slope[i][2] == 0) found = 1;
    if (slope[i][0] == 0 && slope[i][1] == 0)
      found = 1;
    else if (slope[i][0] == 0 || slope[i][1] == 0)
      if (!slope[i][0])
        hor++;
      else
        ver++;
    else
      found = 1;
  }
  int counter = 1;
  for (int i = 0; i < 3; i++)
    if (slope[i][2] == slope[i + 1][2]) counter++;
  if (counter == 4) found = 1;
  if (!found) {
    counter = 1;
    for (int i = 0; i < 4 && counter == 1; i++) {
      counter = 0;
      for (int j = 0; j < 4; j++)
        if (j == i)
          continue;
        else if (slope[i][0] == slope[j][0] && slope[i][1] == slope[j][1] &&
                 slope[i][2] == slope[j][2])
          counter++;
    }
  }
  return !found && ver == hor && counter == 1;
}
int main() {
  int flag = 0;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) {
      scanf("%d", &arr[i][j]);
      if (arr[i][j] < 0) flag = 1;
    }
  if (flag)
    printf("NO");
  else if (solve())
    printf("YES");
  else
    printf("NO");
  return 0;
}
