#include <bits/stdc++.h>
using namespace std;
int n, m;
double d[11];
int v[11];
double dist(double a, double b, double c, double d) {
  return (a - c) * (a - c) + (d - b) * (d - b);
}
struct node {
  double x, y;
} e[11];
bool cmp(node a, node b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
int main() {
  int i, j, k, t;
  double x1, x2, x3, x4, y1, y2, y3, y4;
  double x5, x6, x7, x8, y5, y6, y7, y8;
  while (~scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2)) {
    scanf("%lf%lf%lf%lf", &x3, &y3, &x4, &y4);
    scanf("%lf%lf%lf%lf", &x5, &y5, &x6, &y6);
    scanf("%lf%lf%lf%lf", &x7, &y7, &x8, &y8);
    d[0] = dist(x1, y1, x2, y2);
    d[1] = dist(x3, y3, x4, y4);
    d[2] = dist(x5, y5, x6, y6);
    d[3] = dist(x7, y7, x8, y8);
    sort(d, d + 4);
    if (d[0] == 0) {
      printf("NO\n");
      continue;
    }
    e[0].x = x1;
    e[0].y = y1;
    e[1].x = x2;
    e[1].y = y2;
    e[2].x = x3;
    e[2].y = y3;
    e[3].x = x4;
    e[3].y = y4;
    e[4].x = x5;
    e[4].y = y5;
    e[5].x = x6;
    e[5].y = y6;
    e[6].x = x7;
    e[6].y = y7;
    e[7].x = x8;
    e[7].y = y8;
    sort(e, e + 8, cmp);
    if (e[0].x != e[1].x || e[0].y != e[1].y) {
      printf("NO\n");
      continue;
    }
    if (e[2].x != e[3].x || e[2].y != e[3].y) {
      printf("NO\n");
      continue;
    }
    if (e[4].x != e[5].x || e[4].y != e[5].y) {
      printf("NO\n");
      continue;
    }
    if (e[6].x != e[7].x || e[6].y != e[7].y) {
      printf("NO\n");
      continue;
    }
    if (e[0].x == e[7].x) {
      printf("NO\n");
      continue;
    }
    if (d[0] == d[1] && d[2] == d[3]) {
      double d1 = dist(x1, y1, x2, y2);
      double d2 = dist(x3, y3, x4, y4);
      double d3 = dist(x5, y5, x6, y6);
      double d4 = dist(x7, y7, x8, y8);
      if (x1 == x3 && y1 == y3) {
        double d24 = dist(x2, y2, x4, y4);
        if (d1 + d2 == d24)
          printf("YES\n");
        else
          printf("NO\n");
      }
      if (x1 == x4 && y1 == y4) {
        double d23 = dist(x2, y2, x3, y3);
        if (d1 + d2 == d23)
          printf("YES\n");
        else
          printf("NO\n");
      }
      if (x1 == x5 && y1 == y5) {
        double d26 = dist(x2, y2, x6, y6);
        if (d1 + d3 == d26)
          printf("YES\n");
        else
          printf("NO\n");
      }
      if (x1 == x6 && y1 == y6) {
        double d25 = dist(x2, y2, x5, y5);
        if (d1 + d3 == d25)
          printf("YES\n");
        else
          printf("NO\n");
      }
      if (x1 == x7 && y1 == y7) {
        double d28 = dist(x2, y2, x8, y8);
        if (d1 + d4 == d28)
          printf("YES\n");
        else
          printf("NO\n");
      }
      if (x1 == x8 && y1 == y8) {
        double d27 = dist(x2, y2, x7, y7);
        if (d1 + d4 == d27)
          printf("YES\n");
        else
          printf("NO\n");
      }
    } else
      printf("NO\n");
  }
  return 0;
}
