#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int> PI;
#define MAX 99999999
int main(){
    double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
    while(cin>>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2){
        if((min(xa1,xa2)<=xb1&&xb1<=max(xa1,xa2))||(min(xa1,xa2)<=xb2&&xb2<=max(xa1,xa2)))
            if((min(ya1,ya2)<=yb1&&yb1<=max(ya1,ya2))||(min(ya1,ya2)<=yb2&&yb2<=max(ya1,ya2)))
                cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
}