#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
struct data {
  int x, y;
};
data point[110];
int num[110];
int main() {
  memset(num, 0, sizeof(num));
  int i, j, t, mark = 1, x1 = 0, y1 = 0;
  for (i = 0; i < 8; i += 2) {
    scanf("%d%d", &point[i].x, &point[i].y);
    scanf("%d%d", &point[i + 1].x, &point[i + 1].y);
    if (point[i].x == point[i + 1].x && point[i].y != point[i + 1].y) {
      x1++;
    } else if (point[i].y == point[i + 1].y && point[i].x != point[i + 1].x) {
      y1++;
    } else
      mark = 0;
  }
  if ((x1 != 2)) mark = 0;
  if (y1 != 2) mark = 0;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      if (point[i].x == point[j].x && point[i].y == point[j].y) {
        num[i]++;
      }
    }
  }
  for (i = 0; i < 8; i++) {
    if (num[i] != 2) {
      mark = 0;
    }
  }
  if (mark == 0)
    printf("NO");
  else
    printf("YES");
  cout << endl;
  return 0;
}
