#include <bits/stdc++.h>

using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
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);
}

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;
}

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

typedef vector<P> G;

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;
}

int main(){
    double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2) != EOF){
        G a, b;
        a.push_back(P(xa1, ya1)); a.push_back(P(xa2, ya2));
        a.push_back(P(xa1, ya2)); a.push_back(P(xa2, ya1));
        b.push_back(P(xb1, yb1)); b.push_back(P(xb2, yb2));
        b.push_back(P(xb1, yb2)); b.push_back(P(xb2, yb1));

        bool is = false;
        for(int i=0; i< 4; i++){
            for(int j=0; j< 4; j++){
                if(intersectSS(L(a[i], a[(i+1)%4]), L(b[j], b[(j+1)%4]))) is = true;
            }
        }
        cout << (is?"YES":"NO") << endl;
    }
}