#include <bits/stdc++.h>
using namespace std;
struct Vec {
  int x;
  int y;
};
struct Segment {
  Vec start;
  Vec end;
};
bool same(int v1, int v2) { return v1 == v2; }
bool same(const Vec& v1, const Vec& v2) {
  return same(v1.x, v2.x) && same(v1.y, v2.y);
}
long long dot(const Vec& v1, const Vec& v2) {
  return v1.x * v2.x + v1.y * v2.y;
}
Vec SegToVec(const Segment& seg) {
  Vec res;
  res.x = seg.end.x - seg.start.x;
  res.y = seg.end.y - seg.start.y;
  return res;
}
bool commonStart(const Segment& s1, const Segment& s2) {
  return same(s1.start, s2.start) || same(s1.start, s2.end);
}
bool commonEnd(const Segment& s1, const Segment& s2) {
  return same(s1.end, s2.start) || same(s1.end, s2.end);
}
bool getResult(const vector<Segment>& segments) {
  Vec ox;
  ox.x = 1;
  ox.y = 0;
  Vec oy;
  oy.x = 0;
  oy.y = 1;
  for (int i = 0; i < segments.size(); ++i) {
    if (same(segments[i].start, segments[i].end)) return false;
    Vec vec = SegToVec(segments[i]);
    if (dot(ox, vec) != 0 && dot(oy, vec) != 0) {
      return false;
    }
  }
  for (int i = 0; i < segments.size(); ++i) {
    int perpCount = 0;
    int cStart = 0;
    int cEnd = 0;
    Vec vec_i = SegToVec(segments[i]);
    for (int j = 0; j < segments.size(); ++j) {
      if (j == i) {
        continue;
      }
      if (commonStart(segments[i], segments[j])) {
        ++cStart;
        Vec vec_j = SegToVec(segments[j]);
        if (dot(vec_i, vec_j) == 0) {
          ++perpCount;
        }
      }
      if (commonEnd(segments[i], segments[j])) {
        ++cEnd;
        Vec vec_j = SegToVec(segments[j]);
        if (dot(vec_i, vec_j) == 0) {
          ++perpCount;
        }
      }
    }
    if (!(perpCount == 2 && cStart == 1 && cEnd == 1)) {
      return false;
    }
  }
  return true;
}
int main(int argc, char** argv) {
  vector<Segment> segments;
  for (int i = 0; i < 4; ++i) {
    Segment s;
    cin >> s.start.x >> s.start.y >> s.end.x >> s.end.y;
    segments.push_back(s);
  }
  bool result = getResult(segments);
  if (result) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
