#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
int cmp(double x) {
  if (fabs(x) < eps) return 0;
  if (x > 0) return 1;
  return -1;
}
inline double sqr(double x) { return x * x; }
struct point {
  double x, y;
  point() {}
  point(double a, double b) : x(a), y(b) {}
  friend point operator+(const point &a, const point &b) {
    return point(a.x + b.x, a.y + b.y);
  }
  friend point operator-(const point &a, const point &b) {
    return point(a.x - b.x, a.y - b.y);
  }
  friend bool operator==(const point &a, const point &b) {
    return cmp(a.x - b.x) == 0 && cmp(a.y - b.y) == 0;
  }
  friend point operator*(const point &a, const double &b) {
    return point(a.x * b, a.y * b);
  }
  friend point operator*(const double &a, const point &b) {
    return point(a * b.x, a * b.y);
  }
  friend point operator/(const point &a, const double &b) {
    return point(a.x / b, a.y / b);
  }
  double norm() { return sqrt(sqr(x) + sqr(y)); }
  bool operator<(const point &a) const {
    if (a.x == x)
      return a.y < y;
    else
      return a.x < x;
  }
};
double dot(const point &a, const point &b) { return a.x * b.x + a.y * b.y; }
double dist(const point &a, const point &b) { return (a - b).norm(); }
struct line {
  point a, b;
  line() {}
  line(point x, point y) : a(x), b(y) {}
};
line point_make_line(const point a, const point b) { return line(a, b); }
int main() {
  point a[4], b[4];
  double ang[10] = {0};
  set<point> t;
  for (int i = 0; i < 4; i++) {
    cin >> a[i].x >> a[i].y >> b[i].x >> b[i].y;
    t.insert(a[i]);
    t.insert(b[i]);
  }
  if (t.size() != 4) {
    cout << "NO" << endl;
    return 0;
  }
  int num = 0;
  for (int i = 0; i < 4; i++)
    for (int j = i + 1; j < 4; j++) {
      if (cmp((b[i] - a[i]).norm()) == 0 || cmp((b[j] - a[j]).norm()) == 0) {
        cout << "NO" << endl;
        return 0;
      }
      if (cmp((b[j] - b[i]).norm()) == 0 && cmp((a[j] - a[i]).norm()) == 0) {
        cout << "NO" << endl;
        return 0;
      }
      ang[num++] = fabs(dot(b[i] - a[i], b[j] - a[j]) / (b[i] - a[i]).norm() /
                        (b[j] - a[j]).norm());
    }
  sort(ang, ang + 6);
  if (cmp(ang[0]) == 0 && cmp(ang[3]) == 0 && cmp(ang[4] - 1) == 0 &&
      cmp(ang[5] - 1) == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
