#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);
  }
};
struct Seg {
  Point st, ed;
} line[5];
vector<struct Point> ve;
int flag = 0;
int stk[5];
int inq[5] = {0};
bool Match(struct Seg l, struct Point a, struct Point b) {
  if (l.st == a && l.ed == b) return true;
  if (l.ed == a && l.st == b) return true;
  return false;
}
bool check() {
  for (int i = 1; i <= 4; i++) {
    if (!Match(line[stk[i]], ve[(i + 3) % 4], ve[i % 4])) return false;
  }
  return true;
}
void dfs(int pos) {
  if (pos == 5) {
    if (check()) flag = 1;
    return;
  }
  for (int i = 1; i <= 4; i++) {
    if (inq[i]) continue;
    inq[i] = 1;
    stk[pos] = i;
    dfs(pos + 1);
    inq[i] = 0;
  }
}
bool Rect() {
  if (ve[0].x != ve[1].x) return false;
  if (ve[1].y != ve[2].y) return false;
  if (ve[2].x != ve[3].x) return false;
  if (ve[3].y != ve[0].y) return false;
  return true;
}
int main() {
  for (int i = 1; i <= 4; i++) {
    scanf("%d %d %d %d", &line[i].st.x, &line[i].st.y, &line[i].ed.x,
          &line[i].ed.y);
    ve.push_back(line[i].st);
    ve.push_back(line[i].ed);
  }
  sort(ve.begin(), ve.end());
  ve.erase(unique(ve.begin(), ve.end()), ve.end());
  if (ve.size() != 4) {
    puts("NO");
    return 0;
  }
  swap(ve[2], ve[3]);
  if (!Rect()) {
    puts("NO");
    return 0;
  }
  dfs(1);
  if (flag)
    puts("YES");
  else
    puts("NO");
}
