#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  friend bool operator<(struct Point a, struct Point b) {
    if (a.x != b.x) return a.x < b.x;
    return a.y < b.y;
  }
  friend bool operator==(struct Point a, struct Point b) {
    return (a.x == b.x) && (a.y == b.y);
  }
} st, ed;
map<struct Point, int> mp;
int hor = 0, ver = 0;
bool check() {
  if (mp.size() != 4) return false;
  map<struct Point, int>::iterator it;
  for (it = mp.begin(); it != mp.end(); it++) {
    if (it->second != 2) return false;
  }
  return true;
}
int main() {
  for (int i = 1; i <= 4; i++) {
    scanf("%d %d %d %d", &st.x, &st.y, &ed.x, &ed.y);
    if (st.x == ed.x && st.y != ed.y) ver++;
    if (st.x != ed.x && st.y == ed.y) hor++;
    mp[st]++;
    mp[ed]++;
  }
  if (ver == 2 && hor == 2 && check())
    puts("YES");
  else
    puts("NO");
}
