#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, x = 0, n, a = 0, b = 0;
  int len[5], co[5][5];
  std::map<int, std::map<int, int> > cnt;
  int po[5][3];
  n = 0;
  for (i = 1; i <= 4; i++) {
    scanf("%d %d %d %d", &co[i][1], &co[i][2], &co[i][3], &co[i][4]);
    if (cnt[co[i][3]][co[i][4]] == 0) {
      n++;
      po[n][1] = co[i][3];
      po[n][2] = co[i][4];
    }
    if (!cnt[co[i][1]][co[i][2]]) {
      n++;
      po[n][1] = co[i][1];
      po[n][2] = co[i][2];
    }
    cnt[co[i][1]][co[i][2]]++;
    cnt[co[i][3]][co[i][4]]++;
    if (co[i][1] == co[i][3])
      b++;
    else if (co[i][2] == co[i][4])
      a++;
    if (co[i][1] != co[i][3] && co[i][2] != co[i][4]) {
      x = 1;
    }
    len[i] = 0;
  }
  if (x || a != 2 || b != 2) {
    printf("NO");
    return 0;
  }
  for (i = 1; i <= 4; i++) {
    if (cnt[po[i][1]][po[i][2]] != 2) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
}
