#include <bits/stdc++.h>
using namespace std;
struct iii {
  int a, b, c;
  iii() {}
  iii(int a, int b, int c) : a(a), b(b), c(c) {}
  bool operator<(const iii& e) const {
    return a < e.a || a == e.a && (b < e.b || b == e.b && c < e.c);
  }
};
struct Scanner {
  Scanner& operator>>(int& x) {
    scanf("%d", &x);
    return *this;
  }
  Scanner& operator>>(double& x) {
    scanf("%lf", &x);
    return *this;
  }
  Scanner& operator>>(char* x) {
    scanf("%s", x);
    return *this;
  }
  Scanner& operator>>(long long& x) {
    scanf("%I64d", &x);
    return *this;
  }
  Scanner& operator>>(pair<int, int>& x) {
    scanf("%d%d", &x.first, &x.second);
    return *this;
  }
  Scanner& operator>>(pair<double, double>& x) {
    scanf("%lf%lf", &x.first, &x.second);
    return *this;
  }
} in;
template <typename T>
T sq(const T& x) {
  return x * x;
}
template <typename T>
void minl(T& a, const T& b) {
  if (a > b) a = b;
}
template <typename T>
void maxl(T& a, const T& b) {
  if (a < b) a = b;
}
template <typename T>
void usort(vector<T>& a) {
  sort((a).begin(), (a).end());
  a.erase(unique((a).begin(), (a).end()), a.end());
}
template <typename T>
int index(const vector<T>& a, const T& x) {
  return lower_bound((a).begin(), (a).end(), x) - a.begin();
}
template <typename T>
void operator+=(vector<T>& a, const T& x) {
  a.push_back(x);
}
template <typename T>
bool operator&(const set<T>& a, const T& x) {
  return a.find(x) != a.end();
}
pair<int, int> operator+(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first + b.first, a.second + b.second);
}
pair<int, int> operator-(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first - b.first, a.second - b.second);
}
long long cross(const pair<int, int>& a, const pair<int, int>& b) {
  return (long long)a.first * b.second - (long long)b.first * a.second;
}
long long dot(const pair<int, int>& a, const pair<int, int>& b) {
  return (long long)a.first * b.first + (long long)a.second * b.second;
}
bool check() {
  vector<pair<int, int> > a, b;
  set<pair<int, int> > s;
  set<pair<pair<int, int>, pair<int, int> > > ss;
  for (int i = 0; i < 4; i++) {
    pair<int, int> x, y;
    in >> x >> y;
    if (x == y) return false;
    a += x;
    b += y;
    s.insert(x);
    s.insert(y);
    if (x.first != y.first && x.second != y.second) return false;
    if (ss & (make_pair((x), (y))) || ss & (make_pair((y), (x)))) return false;
    ss.insert(make_pair((x), (y)));
  }
  if (((int)(s).size()) != 4) return false;
  int ord[4] = {0, 1, 2, 3};
  do {
    bool flag = true;
    for (int i = 0; i < 4; i++) {
      int u = ord[i];
      int v = ord[i + 1 & 3];
      if (a[u] == a[v] || a[u] == b[v] || b[u] == a[v] || b[u] == b[v]) {
        if (dot(a[u] - a[v], b[u] - b[v]) == 0) continue;
      }
      flag = false;
      break;
    }
    if (flag) return true;
  } while (next_permutation(ord, ord + 4));
  return false;
}
void york() {
  if (check())
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  york();
  return 0;
}
