#include<iostream>
#include<algorithm>

using namespace std;

int main() {
  double x[4], x_r[4];
  double y[4], y_r[4];

  for(int i = 0; i < 4; i++) {
    cin >> x[i] >> y[i];
    x_r[i] = x[i];
    y_r[i] = y[i];
  }

  sort(x, x + 4);
  sort(y, y + 4);

  int s_x = x[1];
  int s_y = y[1];
  int r_x, r_y;

  if(x[1] == x_r[2]){
    r_x = x[1];
  }else {
    r_x = x_r[1];
  }

  if(y[1] == y_r[2]) {
    r_y = y[1];
  }else {
    r_y = y_r[1];
  }

  if(r_x == s_x && r_y == s_y) {
    cout << "YES" << endl;
  }else {
    cout << "NO" << endl;
  }

  return 0;
}