#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  Point() {}
  Point(int X, int Y) {
    x = X;
    y = Y;
  }
  bool operator==(const Point &p) const { return x == p.x && y == p.y; }
};
struct Segment {
  Point p, q;
  Segment() {}
  Segment read() {
    scanf("%d%d%d%d", &p.x, &p.y, &q.x, &q.y);
    return *this;
  }
  Point getVector() { return Point(p.x - q.x, p.y - q.y); }
};
vector<Segment> v;
bool ok(Segment &s, Segment &t) {
  Point p = s.getVector();
  Point q = t.getVector();
  return p.x * q.x + p.y * q.y == 0;
}
bool good;
int cnt = 0;
int used[5][5];
int maxcnt = 0;
void dfs(int a) {
  ++cnt;
  maxcnt = (maxcnt > cnt ? maxcnt : cnt);
  for (int i = 0; i < 4; ++i) {
    if (a != i && used[a][i] == 0) {
      Point second;
      if (v[a].p == v[i].p || v[a].q == v[i].p) {
        second = v[i].p;
      } else if (v[a].p == v[i].q || v[a].q == v[i].q) {
        second = v[i].q;
      } else {
        continue;
      }
      if (!ok(v[a], v[i])) {
        good = false;
      } else {
        used[a][i] = used[i][a] = 1;
        dfs(i);
      }
    }
  }
  --cnt;
}
int main() {
  int i, j;
  int n, x0;
  memset(used, 0, sizeof(used));
  good = true;
  for (i = 0; i < 4; ++i) {
    v.push_back(Segment().read());
  }
  dfs(0);
  good &= (maxcnt == 5);
  if (good)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
