#include<iostream>
#include<algorithm>
using namespace std;
double x[4],y[4],r[3];
void che(int a,int b){
	if(x[a]>x[b]){
		swap(x[a],x[b]);
		swap(y[a],y[b]);
	}
}
int main(){
	int m=0;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]){
		che(0,1);
		che(1,2);
		che(0,1);
		if(y[0]<=y[3] && y[3]<=y[1]){
			r[0]=x[0]+(x[2]-x[0])*(y[3]-y[0])/(y[2]-y[0]);
			r[1]=x[0]+(x[1]-x[0])*(y[3]-y[0])/(y[1]-y[0]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else if(y[1]<=y[3] && y[3]<=y[2]){
			r[0]=x[2]+(x[0]-x[2])*(y[2]-y[3])/(y[2]-y[0]);
			r[1]=x[2]+(x[1]-x[2])*(y[2]-y[3])/(y[2]-y[1]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else{
			cout<<"NO"<<endl;
			continue;
		}
		if(r[0]<=x[3] && x[3]<=r[1]){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}