#include<bits/stdc++.h>
#define EPS (1e-10)
#define equals(a,b)(fabs((a)-(b))<EPS)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {}
	Point operator*(double a) { return Point(a*x, a*y); }
	Point operator-(Point p) { return Point(x - p.x, y - p.y); }
	double norm() { return x*x + y*y; }
};
typedef vector<Point>Polygon;
struct Segment {
	Point p1, p2;
};
double cross(Point a, Point b) {
	return a.x*b.y - a.y*b.x;
}
double dot(Point a, Point b) {
	return a.x*b.x + a.y*b.y;
}
bool isPrallel(Segment s1, Segment s2) {
	return equals(cross(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}
bool isOrthogonal(Segment s1, Segment s2) {
	return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}
int contains(Polygon g, Point p) {
	int n = g.size();
	bool x = false;
	rep(i, n) {
		Point a = g[i] - p, b = g[(i + 1) % n] - p;
		if (abs(cross(a, b)) < EPS&&dot(a, b) < EPS)return 1;
		if (a.y > b.y)swap(a, b);
		if (a.y < EPS&&EPS<b.y&&cross(a, b)>EPS)x = !x;
	}
	return x ? 2 : 0;
}
int ccw(Point p0, Point p1, Point p2) {
	Point a = p1 - p0;
	Point b = p2 - p0;
	if (cross(a, b) > EPS)return 1;
	if (cross(a, b) < -EPS)return -1;
	if (dot(a, b) < -EPS)return 2;
	if (a.norm() < b.norm())return -2;
	return 0;
}
bool intersect(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 intersect(Segment s1, Segment s2) {
	return intersect(s1.p1, s1.p2, s2.p1, s2.p2);
}
int main() {
	double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
	while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) {
		Polygon
			g1{ { xa1,ya1 },{ xa1,ya2 },{ xa2,ya2 },{ xa2,ya1 } },
			g2{ { xb1,yb1 },{ xb1,yb2 },{ xb2,yb2 },{ xb2,yb1 } };
		bool flag = false;
		rep(i, 4)rep(j, 4)rep(k, 4)rep(t, 4) {
			flag |= intersect(g1[i], g1[j], g2[k], g2[t]);
		}
		bool used = false;
		if (flag) {
			puts("YES");
			used = true;
		}
		else {
			if (xb1 <= xa1&&xa1 <= xb2&&!used) {
				if ((yb1 <= ya1&&ya1 <= yb2) || (yb1 <= ya2&&ya2 <= yb2)) {
					puts("YES");
					used = true;
				}
			}
			if (xb1 <= xa2&&xa2 <= xb2 && !used) {
				if ((yb1 <= ya1&&ya1 <= yb2) || (yb1 <= ya2&&ya2 <= yb2)) {
					puts("YES");
					used = true;
				}
			}
		}
		if (!used)puts("NO");
	}
}