#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> Map;
int tot_x, tot_y, tot;
signed main() {
  for (int i = 1; i <= 4; ++i) {
    int x = 0, y = 0, x_ = 0, y_ = 0;
    scanf("%d %d %d %d", &x, &y, &x_, &y_);
    Map[make_pair(x, y)]++;
    Map[make_pair(x_, y_)]++;
    if (x != x_ && y != y_) return 0 & puts("NO");
    if (x == x_) tot_x++;
    if (y == y_) tot_y++;
    if (Map[make_pair(x, y)] == 2) tot++;
    if (Map[make_pair(x_, y_)] == 2) tot++;
  }
  if (tot_x != 2 || tot_y != 2) return 0 & puts("NO");
  if (tot == 4) return 0 & puts("YES");
  return 0 & puts("NO");
}
