#include <bits/stdc++.h>
struct Point {
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
};
Point operator+(Point a, Point b) { return Point(a.x + b.x, a.y + b.y); }
Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double Length(Point a) { return sqrt(Dot(a, a)); }
const double eps = 1e-10;
int dcmp(int x) {
  if (fabs(x) < eps) return 0;
  return x > 0 ? 1 : -1;
}
bool operator==(Point a, Point b) {
  return !dcmp(a.x - b.x) && !dcmp(a.y - b.y);
}
Point a[4], b[4];
double lenx, leny;
int cntx, cnty;
int main() {
  for (int i = 0; i < 4; i++)
    scanf("%lf%lf%lf%lf", &a[i].x, &a[i].y, &b[i].x, &b[i].y);
  for (int i = 0; i < 4; i++) {
    if (!dcmp(Length(a[i] - b[i]))) {
      printf("NO\n");
      return 0;
    }
    if (!dcmp(a[i].y - b[i].y) &&
        (!lenx || !dcmp(lenx - Length(a[i] - b[i]))) && cntx < 2)
      lenx = Length(a[i] - b[i]), cntx++;
    else if (!dcmp(a[i].x - b[i].x) &&
             (!leny || !dcmp(leny - Length(a[i] - b[i]))) && cnty < 2)
      leny = Length(a[i] - b[i]), cnty++;
    else {
      printf("NO\n");
      return 0;
    }
  }
  for (int i = 0; i < 4; i++) {
    int cnt = 0;
    for (int j = 0; j < 4; j++) {
      if (a[i] == a[j]) cnt++;
      if (a[i] == b[j]) cnt++;
      if (b[i] == a[j]) cnt++;
      if (b[i] == b[j]) cnt++;
    }
    if (cnt != 4) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
}
