#include <bits/stdc++.h>
const double eps = 1e-6;
using namespace std;
int a[4][4], arr[4][2];
bool para(double x1, double y1, double x2, double y2) {
  return abs(x1 * y2 - y1 * x2) < eps;
}
bool pard(double x1, double y1, double x2, double y2) {
  return abs(x1 * x2 + y1 * y2) < eps;
}
bool equ(double x1, double y1, double x2, double y2) {
  return hypot(x1, y1) == hypot(x2, y2);
}
bool rect(double x1, double y1, double x2, double y2, double x3, double y3,
          double x4, double y4) {
  if (equ(x1, y1, x2, y2) && para(x1, y1, x2, y2) && equ(x3, y3, x4, y4) &&
      para(x3, y3, x4, y4) && pard(x1, y1, x3, y3))
    return true;
  if (equ(x1, y1, x3, y3) && para(x1, y1, x3, y3) && equ(x2, y2, x4, y4) &&
      para(x2, y2, x4, y4) && pard(x1, y1, x4, y4))
    return true;
  if (equ(x1, y1, x4, y4) && para(x1, y1, x4, y4) && equ(x3, y3, x2, y2) &&
      para(x3, y3, x2, y2) && pard(x1, y1, x2, y2))
    return true;
  return false;
}
bool para_x(double x) { return !x; }
int main() {
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) scanf("%d", &a[i][j]);
  string s1, s2, s3, s4;
  s1 = s2 = s3 = s4 = "";
  for (int i = 0; i < 4; i++)
    s1 += a[0][i], s2 += a[1][i], s3 += a[2][i], s4 = a[3][i];
  if (s1 == s2 || s1 == s3 || s1 == s4 || s2 == s3 || s2 == s4 || s3 == s4) {
    puts("NO");
    return 0;
  }
  for (int i = 0; i < 4; i++) {
    int x = a[i][0] - a[i][2];
    int y = a[i][1] - a[i][3];
    arr[i][0] = x, arr[i][1] = y;
  }
  double x1 = arr[0][0], y1 = arr[0][1], x2 = arr[1][0], y2 = arr[1][1];
  double x3 = arr[2][0], y3 = arr[2][1], x4 = arr[3][0], y4 = arr[3][1];
  if (rect(x1, y1, x2, y2, x3, y3, x4, y4))
    if (para_x(x1) || para_x(x2) || para_x(x3)) {
      puts("YES");
      return 0;
    }
  puts("NO");
  return 0;
}
