#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )

#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

const double EPS = 1e-8;

struct Point
{
	double x, y;

	Point() : x( 0 ), y( 0 ) {}
	Point( const double x, const double y ) : x( x ), y( y ) {}
	Point( const Point &a ) : x( a.x ), y( a.y ) {}
	
	const Point operator + ( const Point &a ) const
	{
		return Point( x + a.x, y + a.y );
	}

	Point& operator += ( const Point &a ) 
	{
		x += a.x;
		y += a.y;

		return *this;
	}

	const Point operator - ( const Point &a ) const
	{
		return Point( x + ( -a.x ), y + ( -a.y ) );
	}

	Point& operator -= ( const Point &a )
	{
		x -= a.x;
		y -= a.y;

		return *this;
	}

	const Point operator * ( const double a ) const
	{
		return Point( x * a, y * a );
	}

	Point& operator *= ( const double a )
	{
		x *= a;
		y *= a;

		return *this;
	}

	const Point operator / ( const double a ) const
	{
		return Point( x / a, y / a );
	}

	Point& operator /= ( const double a )
	{
		x /= a;
		y /= a;

		return *this;
	}

	bool operator < ( const Point &a ) const
	{
		return x == a.x ? y < a.y : x < a.x;
	}

	double abs() const
	{
		return sqrt( pow( x, 2. ) + pow( y, 2. ) );
	}

	const Point unitVector() const
	{
		return *this / abs();
	}

	const Point normalVector1() const
	{
		return Point( y, -x );
	}

	const Point normalVector2() const
	{
		return Point( -y, x );
	}
};


/*********+************/
/* ベクトルの基本演算 */
/**********************/

// 二点間の距離
double distance( const Point &a, const Point &b )
{
	return ( a - b ).abs();
}

// 内積（ドット積）
double dot( const Point &a, const Point &b )
{
	return a.x * b.x + a.y * b.y;
}

// 外積（クロス積）
double cross( const Point &a, const Point &b )
{
	return a.x * b.y - a.y * b.x;
}

// 線分 ( p1, p2 ) に点 q が乗っているか
bool point_on_segment( const Point &p1, const Point &p2, const Point &q )
{
	// 端点からの q へのベクトルの外積が 0 ⇔ 端点からのベクトルが並行 ⇔ 直線 ( p1, p2 ) に点 q が乗る
	// 端点から q へのベクトルの内積が 0 以下 ⇔ 点 p が p1, p2 の内側にある
	return abs( cross( p1 - q, p2 - q ) ) <= EPS && dot( p1 - q, p2 - q ) <= EPS;
}

// 直線 ( p1, p2 ) と直線 ( q1, q2 ) の交点
Point lines_intersection( const Point &p1, const Point &p2, const Point &q1, const Point &q2 )
{
	return p1 + ( p2 - p1 ) * ( cross( q2 - q1, q1 - p1 ) / cross( q2 - q1, p2 - p1 ) );
}

// 線分 ( p1, p2 ) と線分 ( q1, q2 ) が交差するか
bool segments_intersection( const Point &p1, const Point &p2, const Point &q1, const Point &q2 )
{		
	if ( abs( cross( p1 - p2, q1 - q2 ) ) <= EPS ) // 二直線が並行な場合
	{
		// 片方の線分に他方の端点が乗るか
		return point_on_segment( p1, p2, q1 ) ||
			   point_on_segment( p1, p2, q2 ) ||
			   point_on_segment( q1, q2, p1 ) ||
			   point_on_segment( q1, q2, p2 );
	}
	else
	{
		// 二直線の交点が両方の線分に乗るか
		Point r( lines_intersection( p1, p2, q1, q2 ) );
		return point_on_segment( p1, p2, r ) && point_on_segment( q1, q2, r );
	}
}

// 三角形 ( a, b, c ) の中に点 p があるか
bool point_in_triangle( const Point &a, const Point &b, const Point &c, const Point &p )
{
	int res = 0;
	res += EPS < cross( b - a, p - a ) ? 1 : -1;
	res += EPS < cross( c - b, p - b ) ? 1 : -1;
	res += EPS < cross( a - c, p - c ) ? 1 : -1;

	if ( abs( res ) == 3 ) // 外積の符号が一致すると真
	{
		return true;
	}
	// いずれかの辺に乗るか
	return point_on_segment( a, b, p ) || point_on_segment( b, c, p ) || point_on_segment( c, a, p );
}

// 四角形 ( a, b, c, d ) の中に点 p があるか
// 対角線は ( a, c ) と ( b, d )
bool point_in_square( const Point &a, const Point &b, const Point &c, const Point &d, const Point &p )
{
	return point_in_triangle( a, b, c, p ) || point_in_triangle( a, c, d, p );
}

vector<Point> getPoints( ISS &iss )
{
	vector<Point> res;

	double x1, y1, x2, y2;
	iss >> x1 >> y1 >> x2 >> y2;

	res.PB( Point( x1, y1 ) );
	res.PB( Point( x1, y2 ) );
	res.PB( Point( x2, y2 ) );
	res.PB( Point( x2, y1 ) );
	res.PB( Point( x1, y1 ) );

	return res;
}

string solve( string line )
{
	ISS iss( line );

	vector<Point> ps1 = getPoints( iss ), ps2 = getPoints( iss );
	REP( i, 0, 4 )
	{
		REP( j, 0, 4 )
		{
			if ( segments_intersection( ps1[i], ps1[ i + 1 ], ps2[j], ps2[ j + 1 ] ) )
			{
				return "YES";
			}
		}
	}

	REP( i, 0, 4 )
	{
		if ( point_in_square( ps1[0], ps1[1], ps1[2], ps1[3], ps2[i] ) ||
			 point_in_square( ps2[0], ps2[1], ps2[2], ps2[3], ps1[i] ) )
		{
			return "YES";
		}
	}

	return "NO";
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	string line;
	while ( getline( cin, line ) )
	{
		cout << solve( line ) << endl;
	}

	return 0;
}

Measured memory_bytes: 1248