#include <bits/stdc++.h>
using namespace std;
const int mxn = 2048;
struct pp {
  int x, y;
  pp() {}
  pp(int xx, int yy) {
    x = xx;
    y = yy;
  }
  bool operator<(const pp& p) const {
    if (x == p.x) return y < p.y;
    return x < p.x;
  }
};
pp p[4][2];
int c;
int x1, x2, Y1, Y2;
bool check(pp P1, pp P2, pp P3, pp P4) {
  int vx1 = P2.x - P1.x;
  int vy1 = P2.y - P1.y;
  int vx2 = P3.x - P4.x;
  int vy2 = P3.y - P4.y;
  return vx1 * vx2 + vy1 * vy2 == 0;
}
int main() {
  set<pp> s;
  cin >> x1 >> Y1 >> x2 >> Y2;
  s.insert(pp(x1, Y1));
  p[c][0] = pp(x1, Y1);
  s.insert(pp(x2, Y2));
  p[c++][1] = pp(x2, Y2);
  cin >> x1 >> Y1 >> x2 >> Y2;
  s.insert(pp(x1, Y1));
  p[c][0] = pp(x1, Y1);
  s.insert(pp(x2, Y2));
  p[c++][1] = pp(x2, Y2);
  cin >> x1 >> Y1 >> x2 >> Y2;
  s.insert(pp(x1, Y1));
  p[c][0] = pp(x1, Y1);
  s.insert(pp(x2, Y2));
  p[c++][1] = pp(x2, Y2);
  cin >> x1 >> Y1 >> x2 >> Y2;
  s.insert(pp(x1, Y1));
  p[c][0] = pp(x1, Y1);
  s.insert(pp(x2, Y2));
  p[c++][1] = pp(x2, Y2);
  if (s.size() != 4) {
    puts("NO");
    return 0;
  }
  vector<pp> v;
  for (set<pp>::const_iterator i = s.begin(); i != s.end(); i++)
    v.push_back(*i);
  vector<int> vv;
  for (int i = 0; i < 4; i++) vv.push_back(i);
  bool ok = 0;
  do {
    bool tt = 1;
    tt &= check(v[vv[0]], v[vv[1]], v[vv[1]], v[vv[2]]);
    tt &= check(v[vv[1]], v[vv[2]], v[vv[2]], v[vv[3]]);
    tt &= check(v[vv[2]], v[vv[3]], v[vv[3]], v[vv[0]]);
    tt &= check(v[vv[3]], v[vv[0]], v[vv[0]], v[vv[1]]);
    ok |= tt;
  } while (next_permutation(vv.begin(), vv.end()) && !ok);
  puts(ok ? "YES" : "NO");
}
