#include <bits/stdc++.h>
using namespace std;
const int n = 4;
int a[n][4];
int dotproduct(int x1, int y1, int x2, int y2) { return x1 * x2 + y1 * y2; }
bool findnext(int x0, int x1, int start, int& next) {
  if (a[x0][start * 2] == a[x1][0] && a[x0][start * 2 + 1] == a[x1][1])
    next = 1;
  else if (a[x0][start * 2] == a[x1][2] && a[x0][start * 2 + 1] == a[x1][3])
    next = 0;
  else
    return false;
  if (dotproduct(a[x0][2] - a[x0][0], a[x0][3] - a[x0][1], a[x1][2] - a[x1][0],
                 a[x1][3] - a[x1][1]) != 0)
    return false;
  return true;
}
bool solve() {
  for (int i = 0; i < n; i++)
    if (a[i][0] == a[i][2] && a[i][1] == a[i][3] ||
        a[i][0] != a[i][2] && a[i][1] != a[i][3])
      return false;
  for (int x0 = 0; x0 < 4; x0++)
    for (int x1 = 0; x1 < 4; x1++)
      for (int x2 = 0; x2 < 4; x2++)
        for (int x3 = 0; x3 < 4; x3++)
          if (x0 != x1 && x0 != x2 && x0 != x3 && x1 != x2 && x1 != x3 &&
              x2 != x3) {
            int next;
            if (!findnext(x0, x1, 1, next)) continue;
            if (!findnext(x1, x2, next, next)) continue;
            if (!findnext(x2, x3, next, next)) continue;
            if (!findnext(x3, x0, next, next)) continue;
            return true;
          }
  return false;
}
int main() {
  for (int i = 0; i < n; i++)
    scanf("%d%d%d%d", &a[i][0], &a[i][1], &a[i][2], &a[i][3]);
  if (solve())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
