#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

template<typename T> T add(T x, T y){ if(abs(x+y) < EPS*(abs(x)+abs(y))) return 0; return x + y; }
template<typename T> inline bool semieq(T x, T y){ return abs(x - y) < EPS; }
template<typename T> inline bool semige(T x, T y){ return y - x < -EPS; }
template<typename T> inline bool semile(T x, T y){ return x - y < -EPS; }


struct Point : public complex<double>
{
public:
  Point() { this->real(0);  this->imag(0); }
  Point(const double& x, const double& y) { this->real(x);  this->imag(y); }
  Point(const complex<double> w)  { this->real(w.real());  this->imag(w.imag()); }
  inline double dot(Point p){ return (conj(*this) * p).real(); }  // ??????
  inline double det(Point p){ return (conj(*this) * p).imag(); }  // ??????
};

namespace std
{
  bool operator < (const Point& a, const Point& b)
  {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
typedef vector<Point> Polygon;

int ccw(Point a, Point b, Point c)
{
  b -= a;
  c -= a;
  if(b.det(c) > 0.0)    return  1;         // counter clockwise
  if(b.det(c) < 0.0)    return -1;         // clockwise
  if(b.dot(c) < 0.0)    return  2;         // c--a--b on line
  if(norm(b) < norm(c)) return -2;         // a--b--c on line  return 0;
  return 0.0;
}

struct Line : public vector<Point>
{
public:
  Line(const Point& p, const Point& q){ this->pb(p);  this->pb(q); }

  Line rtn(){ return *this; }
  Point pt(){ return this->at(0); }

  Point projection(Point& p){return this->at(0)+((Point(p-this->at(0))).dot(this->at(0)-this->at(1))/norm(this->at(0)-this->at(1)))*(this->at(0)-this->at(1));}
  Point reflection(Point& p){return p+2.0*(this->projection(p)-p);}
  inline bool intersectionDeterminationOfLL(Line& l){return abs(Point(this->at(1)-this->at(0)).det(l[1]-l[0]))>EPS||abs(Point(this->at(1)-this->at(0)).det(l[0]-this->at(0)))<EPS;}
  inline bool intersectionDeterminationOfLS(Line& s){return (Point(this->at(1)-this->at(0)).det(s[0]-this->at(0)))*(Point(this->at(1)-this->at(0)).det(s[1]-this->at(0)))<EPS;}
  inline bool intersectionDeterminationOfLP(Point& p){return abs(Point(this->at(1)-p).det(this->at(0)-p))<EPS;}
  inline bool intersectionDeterminationOfSS(Line& s){return ccw(this->at(0),this->at(1),s[0])*ccw(this->at(0),this->at(1),s[1])<=0&&ccw(s[0],s[1],this->at(0))*ccw(s[0],s[1],this->at(1))<=0;}
  inline bool intersectionDeterminationOfSP(Point& p){return abs(this->at(0)-p)+abs(this->at(1)-p)-abs(this->at(1)-this->at(0))<EPS;}
  inline double distanceLP(Point& p){return abs(p-this->projection(p));}
  inline double distanceLL(Line& l){return this->intersectionDeterminationOfLL(l)?0.0:this->distanceLP(l[0]);}
  inline double distanceLS(Line& s){return this->intersectionDeterminationOfLS(s)?0.0:min(this->distanceLP(s[0]),this->distanceLP(s[1]));}
  inline double distanceSP(Point& p){Point r=this->projection(p);return this->intersectionDeterminationOfSP(r)?abs(r-p):min(abs(this->at(0)-p),abs(this->at(1)-p));}
  inline double distanceSS(Line& s){return this->intersectionDeterminationOfSS(s)?0.0:min(min(this->distanceSP(s[0]),this->distanceSP(s[1])),min(s.distanceSP(this->at(0)),s.distanceSP(this->at(1))));}
  Point intersection(Line& l){
    double A = Point(this->at(1)-this->at(0)).det(l[1]-l[0]);
    double B = Point(this->at(1)-this->at(0)).det(this->at(1)-l[0]);
    if(abs(A)<EPS && abs(B)<EPS) return l[0];
    if(abs(A)<EPS) assert(false);
    return l[0] + B/A * (l[1]-l[0]);
  }
};

#define currPoint(P, i) P[i]
#define nextPoint(P, i) P[(i+1)%P.size()]

enum { OUT, ON, IN };
int contains(const Polygon& P, const Point& p)
{
  bool in = false;
  for (int i = 0; i < P.size(); ++i) {
    Point a = currPoint(P,i) - p, b = nextPoint(P,i) - p;
    if (semige(imag(a), imag(b))) swap(a, b);
    if (!semige(imag(a), 0.0) && semile(0.0, imag(b)))
      if (semile(a.det(b), 0.0)) in = !in;
    if (semieq(a.det(b), 0.0) && !semige(a.dot(b), 0.0)) return ON;
  }
  return in ? IN : OUT;
}

double x[4];
double y[4];

int main()
{
  while(cin >> x[0] >> y[0] >> x[2] >> y[2]){
    x[1] = x[2];  y[1] = y[0];
    x[3] = x[0];  y[3] = y[2];
    Polygon a;
    vector<Line> A;
    rep(i, 4) a.pb(Point(x[i], y[i]));
    rep(i, 4) A.pb(Line(currPoint(a, i), nextPoint(a, i)));

    cin >> x[0] >> y[0] >> x[2] >> y[2];
    x[1] = x[2];  y[1] = y[0];
    x[3] = x[0];  y[3] = y[2];
    Polygon b;
    vector<Line> B;
    rep(i, 4) b.pb(Point(x[i], y[i]));
    rep(i, 4) B.pb(Line(currPoint(b, i), nextPoint(b, i)));

    bool ok = false;
    //vrep(v, A) vrep(w, B) ok |= v->intersectionDeterminationOfSS(*w);


    rep(i, 4) ok |= (contains(a, b[i]) != OUT);
    rep(i, 4) ok |= (contains(b, a[i]) != OUT);

    puts(ok ? "YES" : "NO");
  }


  return 0;
}