 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 
 using namespace std;
 
 typedef struct
 {
   double x,y;        
 }Point;
 
 Point A1,A2,B1,B2;
 Point A1B1,B2B1,A2A1,B2A1;
 
 double xx(Point &s,Point &t)
 {
   return (s.x*t.y+s.y*t.x);       
 }
 
 int kua()
 {
   A1B1.x=A1.x-B1.x;
   A1B1.y=A1.y-B1.y;
   B2B1.x=B2.x-B1.x;
   B2B1.y=B2.y-B1.y;
   A2A1.x=A2.x-A1.x;
   A2A1.y=A2.y-A1.y;
   B2A1.x=B2.x-A1.x;
   B2A1.y=B2.y-A1.y;
   if(xx(A1B1,B2B1)*xx(B2B1,A2A1)>=0)
   {
     A1B1.y=-A1B1.y;
     A1B1.x=-A1B1.x;
     if(xx(A1B1,A2A1)*xx(A2A1,B2A1)>=0) return 1;
     else return 0;                                  
   }    
   else return 0;
 }

 int main()
 {
   Point A1,A2,B1,B2;
   while(cin>>A1.x>>A1.y>>A2.x>>A2.y>>B1.x>>B1.y>>B2.x>>B2.y)
   {
     if(min(A1.x,A2.x)<=max(B1.x,B2.x)&&
        min(B1.x,B2.x)<=max(A1.x,A2.x)&&
        min(A1.y,A2.y)<=max(B1.y,B2.y)&&
        min(B1.y,B2.y)<=max(A1.y,A2.y))
      {
        //if(kua()) cout<<"YES"<<endl;
        cout<<"YES"<<endl;                                 
      }                       
      else cout<<"NO"<<endl;                                   
   }   
   //while(1);
   return 0;
 }