#include <bits/stdc++.h>
using namespace std;
struct P {
  int64_t x = 0, y = 0;
  P() {}
  P(int64_t x, int64_t y) : x(x), y(y) {}
  P operator-(const P &b) const { return P(x - b.x, y - b.y); }
  int64_t operator*(const P &b) const { return x * b.x + y * b.y; }
  int64_t operator/(const P &b) const { return x * b.y - y * b.x; }
  bool operator==(const P &b) const { return x == b.x && y == b.y; }
  bool operator!=(const P &b) const { return x != b.x || y != b.y; }
};
struct S {
  P p, q;
};
bool check(S a, S b, S c, S d) {
  if ((a.p - a.q).x && (a.p - a.q).y) return false;
  if (b.p != a.q) swap(b.p, b.q);
  if (b.p != a.q) return false;
  if (c.p != b.q) swap(c.p, c.q);
  if (c.p != b.q) return false;
  if (d.p != c.q) swap(d.p, d.q);
  if (d.p != c.q) return false;
  if (a.p != d.q) return false;
  if (a.p == a.q || b.p == b.q || c.p == c.q || d.p == d.q) return false;
  if ((b.q - a.q) * (a.p - a.q)) return false;
  if ((c.q - b.q) * (b.p - b.q)) return false;
  if ((d.q - c.q) * (c.p - c.q)) return false;
  if ((a.q - d.q) * (d.p - d.q)) return false;
  return true;
}
int main() {
  S s[4];
  for (int i = 0; i < 4; ++i) {
    cin >> s[i].p.x >> s[i].p.y >> s[i].q.x >> s[i].q.y;
  }
  if (check(s[0], s[1], s[2], s[3]) || check(s[0], s[1], s[3], s[2]) ||
      check(s[0], s[2], s[1], s[3]) || check(s[0], s[2], s[3], s[1]) ||
      check(s[0], s[3], s[1], s[2]) || check(s[0], s[3], s[2], s[1]))
    puts("YES");
  else
    puts("NO");
  return 0;
}
