#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
bool doubleEqual(long double a, long double b) { return fabs(a - b) < EPS; }
bool doubleLessOrEqual(long double a, long double b) {
  return doubleEqual(a, b) || a < b;
}
bool doubleLess(long double a, long double b) {
  return !doubleEqual(a, b) && a < b;
}
bool doubleGreaterOrEqual(long double a, long double b) {
  return a > b || doubleEqual(a, b);
}
bool doubleGreater(long double a, long double b) {
  return a > b && !doubleEqual(a, b);
}
long double mySqrt(long double a) {
  if (a < 0) {
    return 0;
  }
  return sqrt(a);
}
long double sqr(long double a) { return a * a; }
struct Point {
  long double x, y;
  Point() : x(0), y(0) {}
  Point(long double x, long double y) : x(x), y(y) {}
  Point operator-(const Point &p) const { return {x - p.x, y - p.y}; }
  Point operator+(const Point &p) const { return {x + p.x, y + p.x}; }
  Point &operator+=(const Point &p) {
    x += p.x, y += p.y;
    return *this;
  }
  long double operator%(const Point &p) const { return x * p.x + y * p.y; }
  long double operator*(const Point &p) const { return x * p.y - p.x * y; }
  Point operator/(long double k) const { return {x / k, y / k}; }
  Point &operator/=(long double k) {
    x /= k;
    y /= k;
    return *this;
  }
  bool operator<(const Point &p) const {
    return x < p.x || (x == p.x && y < p.y);
  }
  Point operator*(long double k) const { return {x * k, y * k}; }
  Point &operator*=(long double k) {
    x *= k, y *= k;
    return *this;
  }
  long double length() const { return mySqrt(*this % *this); }
  long double distTo(const Point &p) const { return (*this - p).length(); }
  long double distTo(const Point &A, const Point &B) const {
    long double d = A.distTo(B);
    long double s = (*this - A) * (*this - B);
    return fabs(s) / d;
  }
  Point normalize(long double k = 1.0) const {
    long double len = length();
    return *this * (k / len);
  }
  Point getH(const Point &A, const Point &B) const {
    Point C = *this;
    Point v = B - A;
    Point u = C - A;
    long double k = v % u / v.length();
    v = v.normalize(k);
    Point H = A + v;
    return H;
  }
  Point rotate() const { return {-y, x}; }
  Point rotate(long double alpha) const {
    Point v = *this;
    Point w;
    w.x = v.x * cos(alpha) - v.y * sin(alpha);
    w.y = v.x * sin(alpha) + v.y * cos(alpha);
    return w;
  }
  bool isOnLine(const Point &A, const Point &B) const {
    return doubleEqual((*this - A) * (*this - B), 0.0);
  }
  bool isInSegment(const Point &A, const Point &B) const {
    return isOnLine(A, B) && doubleLessOrEqual((A - *this) % (B - *this), 0);
  }
  bool isInSegmentStrictly(const Point &A, const Point &B) const {
    return isOnLine(A, B) && doubleLess((A - *this) % (B - *this), 0);
  }
  long double getAngle() { return atan2(y, x); }
  long double getAngle(const Point &p) const {
    return atan2(p * *this, p % *this);
  }
};
int getTangent(const Point &A, const Point &O, long double r, Point &M,
               Point &N) {
  Point v = O - A;
  long double d = v.length();
  long double alpha = asin(r / d);
  long double L = mySqrt(sqr(d) - sqr(r));
  v = v.normalize(L);
  M = A + v.rotate(alpha);
  N = A + v.rotate(-alpha);
  if (doubleEqual(r, d)) return 1;
  return 2;
}
istream &operator>>(istream &in, Point &A) {
  in >> A.x >> A.y;
  return in;
}
ostream &operator<<(ostream &in, Point &A) {
  in << A.x << A.y;
  return in;
}
Point O;
bool cmp(const Point &A, const Point &B) {
  return (A - O) * (B - O) < 0 ||
         ((A - O) * (B - O) == 0 && (A - O).length() < (B - O).length());
}
vector<Point> convexHull(vector<Point> &a) {
  vector<Point> convex;
  convex.push_back(O);
  for (int i = 1; i < a.size(); ++i) {
    Point A = convex.back() - convex[convex.size() - 2],
          B = a[i] - convex.back();
    long double k = A * B;
    while (convex.size() > 1 && ((convex.back() - convex[convex.size() - 2]) *
                                     (a[i] - convex.back()) >=
                                 0)) {
      convex.pop_back();
    }
    convex.push_back(a[i]);
  }
  return convex;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Point A, B, C, D, E, F, G, H;
  cin >> A >> B >> C >> D >> E >> F >> G >> H;
  set<Point> q;
  map<pair<Point, Point>, bool> was;
  was[{A, B}] = 1;
  was[{C, D}] = 1;
  was[{E, F}] = 1;
  was[{G, H}] = 1;
  q.insert(A);
  q.insert(B);
  q.insert(C);
  q.insert(D);
  q.insert(E);
  q.insert(F);
  q.insert(G);
  q.insert(H);
  if (q.size() != 4) {
    cout << "NO\n";
    return 0;
  }
  vector<Point> pts;
  for (auto x : q) {
    pts.push_back(x);
  }
  Point O1;
  long double sq = 0;
  sort(pts.begin(), pts.end());
  O = pts[0];
  sort(pts.begin() + 1, pts.end(), cmp);
  pts = convexHull(pts);
  for (int i = 0; i < 4; ++i) {
    int next = (i + 1) % 4;
    sq += (pts[i] - O1) * (pts[next] - O1);
    if (!was[{pts[i], pts[next]}] && !was[{pts[next], pts[i]}]) {
      cout << "NO\n";
      return 0;
    }
  }
  sq = abs(sq) / 2;
  long double sq1 = pts[0].distTo(pts[1]) * pts[0].distTo(pts[3]);
  if (sq == sq1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
