#include <stdio.h>

#define MAX(A,B) \
  ( (A) > (B) ? (A) : (B) )
#define MIN(A,B) \
  ( (A) < (B) ? (A) : (B) )
#define ISINNER(X,A,B) \
  ( MIN(A,B) <= (X) && (X) <= MAX(A,B) )

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;

  while ( scanf ( "%lf%lf%lf%lf%lf%lf%lf%lf",
            &xa1, &ya1, &xa2, &ya2, &xb1, &yb1, &xb2, &yb2 ) == 8 )
  {
    puts ( ( ISINNER( xb1, xa1, xa2 ) && ISINNER( yb1, ya1, ya2 ) )
        || ( ISINNER( xb2, xa1, xa2 ) && ISINNER( yb2, ya1, ya2 ) )
         ? "YES"
         : "NO" );
  }

  return ( 0 );
}