#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>

using namespace std;

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)

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 own_dot(){return x*x+y*y;};
  double abs(){return sqrt(own_dot());}

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

struct Segment{Point p1,p2;};

double dot(Point a, Point b){
  return a.x*b.x+a.y*b.y;
}
double cross(Point a, Point 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){
  Point a = p1-p0;
  Point 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.own_dot() < b.own_dot()) 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);
}


Point in[8];
Segment seg[8];

int main(){
  while(1){
    
    for(int i = 0; i < 4; i+=2)
      if(!(cin >> in[i].x >> in[i].y)) return 0;

    for(int i = 4; i < 8; i+=2)
      cin >> in[i].x >> in[i].y;
    
    in[1] = Point(in[0].x, in[2].y);
    in[3] = Point(in[2].x, in[0].y);
    in[5] = Point(in[4].x, in[6].y);
    in[7] = Point(in[6].x, in[4].y);
    
    for(int i = 0; i < 4; i++){
      seg[i].p1 = in[i];
      seg[i].p2 = in[(i+1)%4];
    }

    for(int i = 4; i < 8; i++){
      seg[i].p1 = in[i];
      if(i == 7) seg[i].p2 = in[4];
      else seg[i].p2 = in[i+1];
    }
 

    bool ans = false;

    if(in[0].x <=  in[4].x && in[0].y <= in[4].y && in[2].x >= in[6].x && in[2].y >= in[6].y ||
       in[0].x >=  in[4].x && in[0].y >= in[4].y && in[2].x <= in[6].x && in[2].y <= in[6].y)
      ans = true;

    for(int i = 0; i < 4; i++)
      for(int j = 4; j < 8; j++)
	ans = (ans||isIntersect(seg[i],seg[j]));


    if(ans) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}