#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
bool pt(double px,double py,double qx,double qy,double rx,double ry,double sx,double sy){
  if(((rx-qx)*(py-qy)-(px-qx)*(ry-qy)<=0&&(sx-rx)*(py-ry)-(px-rx)*(sy-ry)<=0&&(qx-sx)*(py-sy)-(px-sx)*(qy-sy)<=0)||
     ((rx-qx)*(py-qy)-(px-qx)*(ry-qy)>=0&&(sx-rx)*(py-ry)-(px-rx)*(sy-ry)>=0&&(qx-sx)*(py-sy)-(px-sx)*(qy-sy)>=0))
    return 1;
  return 0;
}
bool rr(double px[],double py[],double qx[],double qy[]){
  int i;
  for(i=0;i<4;i++){
    if(pt(px[i],py[i],qx[0],qy[0],qx[1],qy[1],qx[2],qy[2])||
       pt(px[i],py[i],qx[0],qy[0],qx[2],qy[2],qx[3],qy[3])||
       pt(qx[i],qy[i],px[0],py[0],px[1],py[1],px[2],py[2])||
       pt(qx[i],qy[i],px[0],py[0],px[2],py[2],px[3],py[3]))
      return 1;
  }
  return 0;
}
int main(){
  double px[4],py[4],qx[4],qy[4];
  while(cin>>px[1]>>py[1]>>px[3]>>py[3]>>qx[1]>>qy[1]>>qx[3]>>qy[3]){
    px[0]=px[3];
    py[0]=py[1];
    px[2]=px[1];
    py[2]=py[3];
    qx[0]=qx[3];
    qy[0]=qy[1];
    qx[2]=qx[1];
    qy[2]=qy[3];
    if(rr(px,py,qx,qy))
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
  return 0;
}