#include <bits/stdc++.h>
using namespace std;
bool gor(vector<long> v, vector<long> g) {
  if (g[0] > g[2]) swap(g[0], g[2]);
  if (v[1] > v[3]) swap(v[1], v[3]);
  if (g[0] <= v[0] && v[0] <= g[2] && v[1] <= g[1] && g[1] <= v[3])
    return true;
  else
    return false;
}
int main() {
  vector<vector<long> > m(4, vector<long>(4, 0));
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      cin >> m[i][j];
    }
  }
  vector<int> v, g;
  for (int i = 0; i < 4; ++i) {
    if (m[i][0] == m[i][2]) {
      v.push_back(i);
    } else if (m[i][1] == m[i][3]) {
      g.push_back(i);
    }
  }
  if (gor(m[v[0]], m[g[0]])) {
    if (gor(m[v[0]], m[g[1]])) {
      if (gor(m[v[1]], m[g[0]])) {
        if (gor(m[v[1]], m[g[1]])) {
          cout << "Yes";
          return 0;
        }
      }
    }
  }
  cout << "No";
  return 0;
}
