#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> M;
pair<int, int> pos[10];
int tot = 0;
int go(int x, int y) {
  if (M[pair<int, int>(x, y)] == 0) {
    M[pair<int, int>(x, y)] = ++tot;
    pos[tot] = pair<int, int>(x, y);
  }
  return M[pair<int, int>(x, y)];
}
pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {
  a.first -= b.first;
  a.second -= b.second;
  return a;
}
vector<pair<int, int> > l[10];
bool cz(pair<int, int> a, pair<int, int> b) {
  if ((long long)a.first * b.first + (long long)a.second * b.second == 0)
    return 1;
  return 0;
}
void check() {
  if (tot != 4) {
    printf("NO\n");
    return;
  }
  for (int i = (1); i <= (4); i++) {
    if (l[i].size() != 2) {
      printf("NO\n");
      return;
    }
    if (!cz(l[i][0] - pos[i], l[i][1] - pos[i])) {
      printf("NO\n");
      return;
    }
  }
  printf("YES\n");
}
int main() {
  int x1, y1, x2, y2;
  bool side = 0;
  for (int i = (1); i <= (4); i++) {
    cin >> x1 >> y1 >> x2 >> y2;
    int i1 = go(x1, y1), i2 = go(x2, y2);
    l[i1].push_back(pair<int, int>(x2, y2));
    l[i2].push_back(pair<int, int>(x1, y1));
    if (x1 != x2 && y1 != y2) side = 1;
    if (x1 == x2 && y1 == y2) side = 1;
  }
  if (side) {
    printf("NO\n");
  } else
    check();
  return 0;
}
