#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-10;
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); }
Point operator*(Point a, double k) { return Point(a.x * k, a.y * k); }
Point operator/(Point a, double k) { return Point(a.x / k, a.y / k); }
int dcmp(double x) {
  if (fabs(x) < EPS)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
bool operator<(Point a, Point b) {
  if (dcmp(a.x - b.x) == 0)
    return dcmp(a.y - b.y) < 0;
  else
    return dcmp(a.x - b.x) < 0;
}
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double Length(Point a) { return sqrt(Dot(a, a)); }
Point p[8 + 5];
Point v[8 + 5];
set<Point> Set;
int main() {
  for (int i = 1; i <= 8; i++) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    Set.insert(p[i]);
  }
  if (Set.size() != 4) {
    puts("NO");
    return 0;
  }
  Point e1 = Point(0, 1), e2 = Point(1, 0);
  bool flag = true;
  for (int i = 1; i <= 4; i++) {
    v[i] = p[i * 2 - 1] - p[i * 2];
    if (dcmp(Cross(e1, v[i])) == 0 || dcmp(Cross(e2, v[i])) == 0)
      ;
    else
      flag = false;
  }
  if (!flag) {
    puts("NO");
    return 0;
  }
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 4; j++)
      for (int k = 1; k <= 4; k++)
        for (int l = 1; l <= 4; l++) {
          if (i == j || i == k || i == l) continue;
          if (j == k || j == l) continue;
          if (k == l) continue;
          if (Length(v[i]) == Length(v[j]) && Cross(v[i], v[j]) == 0 &&
              Length(v[k]) == Length(v[l]) && Cross(v[k], v[l]) == 0) {
            puts("YES");
            return 0;
          }
        }
  puts("NO");
}
