#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[13];
int main() {
  for (int i = 1; i <= 8; ++i) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + 9);
  for (int i = 1; i <= 8; i += 2)
    if (a[i] != a[i + 1]) return printf("NO"), 0;
  for (int i = 2; i < 8; i += 2)
    if (a[i] == a[i + 1]) return printf("NO"), 0;
  printf("YES");
  return 0;
}
