#include <bits/stdc++.h>
using namespace std;
long long n, i, j, ans = 0, a, b, c, d;
vector<long long> v[5], X, Y;
vector<pair<long long, long long> > XX, YY;
string s = "NO";
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (i = 1; i <= 4; i++) {
    cin >> a >> b >> c >> d;
    v[i].push_back(a), v[i].push_back(b), v[i].push_back(c), v[i].push_back(d);
    if (a == c and b == d) return cout << s, 0;
    if (b == d) {
      X.push_back(i);
      continue;
    }
    if (a == c) {
      Y.push_back(i);
      continue;
    }
    return cout << s, 0;
  }
  if (X.size() != 2 and Y.size() != 2) return cout << s, 0;
  for (i = 1; i <= n; i++)
    for (j = 1 + i; j <= 4; j++)
      if (v[i][1 - 1] == v[j][1 - 1] and v[i][1] == v[j][1] and
          v[i][2] == v[j][2] and v[i][3] == v[j][3])
        return cout << s, 0;
  long long lenY1 = (v[Y[0]][0] - v[Y[0]][2]) * (v[Y[0]][0] - v[Y[0]][2]) +
                    (v[Y[0]][1] - v[Y[0]][3]) * (v[Y[0]][1] - v[Y[0]][3]);
  long long lenY2 = (v[Y[1]][0] - v[Y[1]][2]) * (v[Y[1]][0] - v[Y[1]][2]) +
                    (v[Y[1]][1] - v[Y[1]][3]) * (v[Y[1]][1] - v[Y[1]][3]);
  if (lenY1 != lenY2) return cout << s, 0;
  long long lenX1 = (v[X[0]][0] - v[X[0]][2]) * (v[X[0]][0] - v[X[0]][2]) +
                    (v[X[0]][1] - v[X[0]][3]) * (v[X[0]][1] - v[X[0]][3]);
  long long lenX2 = (v[X[1]][0] - v[X[1]][2]) * (v[X[1]][0] - v[X[1]][2]) +
                    (v[X[1]][1] - v[X[1]][3]) * (v[X[1]][1] - v[X[1]][3]);
  if (lenX1 != lenX2) return cout << s, 0;
  for (i = 0; i < 2; i++) {
    a = Y[i];
    YY.push_back({v[a][0], v[a][1]}), YY.push_back({v[a][2], v[a][3]});
  }
  for (i = 0; i < 2; i++) {
    a = X[i];
    XX.push_back({v[a][0], v[a][1]}), XX.push_back({v[a][2], v[a][3]});
  }
  for (i = 0; i < XX.size(); i++) {
    int f = 0;
    for (j = 0; j < YY.size(); j++) {
      if (XX[i] == YY[j]) {
        YY.erase(YY.begin() + j);
        f++;
        break;
      }
    }
    if (!f) return cout << s, 0;
  }
  cout << "YES";
}
