#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}

double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}


struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}

double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;

bool solve(){
    vector<L> a, b;
    a.push_back(L(P(xa1, ya1), P(xa2, ya1)));
    a.push_back(L(P(xa2, ya1), P(xa2, ya2)));
    a.push_back(L(P(xa2, ya2), P(xa1, ya2)));
    a.push_back(L(P(xa1, ya2), P(xa1, ya1)));
    b.push_back(L(P(xb1, yb1), P(xb2, yb1)));
    b.push_back(L(P(xb2, yb1), P(xb2, yb2)));
    b.push_back(L(P(xb2, yb2), P(xb1, yb2)));
    b.push_back(L(P(xb1, yb2), P(xb1, yb1)));
    REP(i, a.size()) REP(j, b.size()) if(intersectSS(a[i], b[j])) return true;
    if(xa1 <= xb1 && ya1 <= yb1 && xa2 >= xb2 && ya2 >= yb2) return true;
    if(xb1 <= xa1 && yb1 <= ya1 && xb2 >= xa2 && yb2 >= ya2) return true;
    return false;
}

int main() {
  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF) cout <<(solve() ? "YES" : "NO") <<endl;
  return 0;
}