#include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)
const double EPS=1e-6;

int main(){

	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd){

		double a=(xc-xa)*(yd-ya)-(yc-ya)*(xd-xa);
		double b=(xc-xa)*(yb-ya)-(yc-ya)*(xb-xa);
		double c=(xd-xb)*(ya-yb)-(yd-yb)*(xa-xb);
		double d=(xd-xb)*(yc-yb)-(yd-yb)*(xc-xb);


		if(a*b<0.0 && c*d<0.0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}