#include <bits/stdc++.h>
using namespace std;

void ans(bool f) {
  cout << (f ? "YES" : "NO") << endl;
}

bool solve(vector<pair<long long, long long>> &v) {
  vector<pair<long long, int>> x, y;
  for (int i = 0; i < 4; ++i) {
    x.push_back(make_pair(v[i].first, i / 2));
    y.push_back(make_pair(v[i].second, i / 2));
  }

  sort(x.begin(), x.end());
  sort(y.begin(), y.end());

  return ((x[0].second != x[1].second || x[1].first == x[2].first) &&
          (y[0].second != y[1].second || y[1].first == y[2].first));
}

int main() {
  long double x, y;
  while (cin >> x >> y) {
    vector<pair<long long, long long>> in;
    in.push_back(make_pair((long long)(100000.0 * x), (long long)(100000.0 * y)));
    for (int i = 0; i < 3; ++i) {
      cin >> x >> y;
      in.push_back(make_pair((long long)(100000.0 * x), (long long)(100000.0 * y)));
    }

    ans(solve(in));
  }
}