#include <iostream>
#include <cmath>
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)

using namespace std;

class Point{
public:
  double x, y;
  Point (double x=0, double y=0): x(x), y(y){}
  Point operator + (Point p){ return Point(x+p.x, y+p.y); }
  Point operator - (Point p){ return Point(x-p.x, y-p.y); }
  Point operator * (double a){ return Point (a*x, a*y); }
  double abs(){ return sqrt(norm());}
  double norm(){ return x*x+y*y;}
  bool operator < (const Point &p) const{
    return x!=p.x?x<p.x:y<p.y;
  }
  bool operator == ( const Point &p) const{
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

typedef Point Vector;
struct Segment{
  Point p1, p2;
};
double dot(Vector a, Vector b){
  return a.x*b.x+a.y*b.y;
}
double cross(Vector a, Vector b){
  return a.x*b.y-a.y*b.x;
}
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw(Point p0, Point p1, Point p2){
  Vector a=p1-p0;
  Vector b=p2-p0;
  if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
  if(cross(a, b) < -EPS) return CLOCKWISE;
  if(dot(a, b) < -EPS) return ONLINE_BACK;
  if(a.norm() < b.norm()) return ONLINE_FRONT;
  return ON_SEGMENT;
}
bool isIntersect(Point p1, Point p2, Point p3, Point p4){
  return ( ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
	   ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0 );
}
bool isIntersect(Segment s1, Segment s2){
  return isIntersect(s1.p1, s1.p2, s2.p1, s2.p2);
}

main(){
  double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
  while(cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2){
    Segment a[4], b[4];
    Point pa[4], pb[4];
    pa[0].x=xa1;
    pa[0].y=ya2;
    pa[1].x=xa2;
    pa[1].y=ya2;
    pa[2].x=xa2;
    pa[2].y=ya1;
    pa[3].x=xa1;
    pa[3].y=ya1;

    pb[0].x=xb1;
    pb[0].y=yb2;
    pb[1].x=xb2;
    pb[1].y=yb2;
    pb[2].x=xb2;
    pb[2].y=yb1;
    pb[3].x=xb1;
    pb[3].y=yb1;

    a[0].p1=pa[0];
    a[0].p2=pa[1];

    a[1].p1=pa[1];
    a[1].p2=pa[2];

    a[2].p1=pa[2];
    a[2].p2=pa[3];

    a[3].p1=pa[3];
    a[3].p2=pa[0];

    b[0].p1=pb[0];
    b[0].p2=pb[1];

    b[1].p1=pb[1];
    b[1].p2=pb[2];

    b[2].p1=pb[2];
    b[2].p2=pb[3];

    b[3].p1=pb[3];
    b[3].p2=pb[0];

    bool ans=false;
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
	if(isIntersect(a[i], b[j])){
	  ans=true;
	}
      }
    }
    if(ans){
      cout << "YES" << endl;
      continue;
    }
    ans=false;
    for(int i=0;i<4;i++){
      if(pb[i].x>=xa1 && pb[i].x<=xa2){
	if(pb[i].y>=ya1 && pb[i].y<=ya2){
	  ans=true;
	  break;
	}
      }
    }
    if(ans){
      cout << "YES" << endl;
      continue;
    }
    ans=false;
    for(int i=0;i<4;i++){
      if(pa[i].x>=xb1 && pa[i].x<=xb2){
	if(pa[i].y>=yb1 && pa[i].y<=yb2){
	  ans=true;
	  break;
	}
      }
    }
    if(ans){
      cout << "YES" << endl;
      continue;
    }
    cout << "NO" << endl;
  }
  return 0;
}