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

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

typedef vector<P> G;

#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
int contains(const G& g, const P& p) {
    bool in = false;
    for (int i = 0; i < g.size(); ++i) {
        P a = curr(g,i) - p, b = next(g,i) - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b))
            if (cross(a, b) < 0) in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0) return true;
    }
    return in ? true : false;
}

bool overlap(const G& a, const G& b){
    int count = 0;
    for(int i=0; i < b.size(); i++){
        if(contains(a, b[i])) count++;
    }
    return count != 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));

        cout << (overlap(a, b) || overlap(b, a)?"YES":"NO") << endl;
    }
}