#include<iostream>
#include<cmath>
#define F first
#define S second
#define EPS 1e-10
using namespace std;
typedef pair<double,double> P;

int main(){
  P p1,p2,p3,p4;
  while(cin >> p1.F >> p1.S >> p2.F >> p2.S >> p3.F >> p3.S >> p4.F >> p4.S){
    if(!(p4.F - p1.F < EPS) && !(EPS < -p2.F + p3.F) ){
      if(!(p4.S - p1.S < EPS) && !(p2.S - p3.S < EPS))cout << "YES" << endl;      
      else cout << "NO" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
  return 0;
}