#include <bits/stdc++.h>
using namespace std;
struct point {
  long long int x, y;
};
point p[4];
long long int dis(point a, point b) {
  return (long long int)pow(a.x - b.x, 2) + (long long int)pow(a.y - b.y, 2);
}
bool check(point a, point b, point c, point d) {
  bool ok1 = dis(a, b) == dis(c, d) && dis(a, d) == dis(b, c);
  bool ok2 = (a.y == b.y) && (d.y == c.y) && (a.x == d.x) && (b.x == c.x);
  return ok1 && ok2;
}
void solve(int testcase) {
  for (int i = (0); i <= (3); i++) cin >> p[i].x >> p[i].y;
  vector<int> idx = {0, 1, 2, 3};
  do {
    point a = p[idx[0]];
    point b = p[idx[1]];
    point c = p[idx[2]];
    point d = p[idx[3]];
    if (check(a, b, c, d)) {
      cout << "YES";
      return;
    }
  } while (next_permutation(idx.begin(), idx.end()));
  cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(10);
  clock_t b = clock();
  int t = 1;
  for (int tt = (1); tt <= (t); tt++) solve(tt);
  clock_t e = clock();
  cerr << (double(e - b) / CLOCKS_PER_SEC) << " sec";
  return 0;
}
