#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

vector<int>uku(){
	vint ret(3);
	rep(i,3)cin>>ret[i];
	return ret;
}


vint cross(vint A,vint B,vint C){
	rep(i,3){
		B[i]-=A[i];
		C[i]-=A[i];
	}
	return {B[1]*C[2]-B[2]*C[1],B[2]*C[0]-B[0]*C[2],B[0]*C[1]-B[1]*C[0]};
}

int dot(vint A,vint B){
	int ret=0;
	rep(i,3)ret+=A[i]*B[i];
	return ret;
}

signed main(){
	vint A,B,C,D;
	A=uku();B=uku();C=uku();D=uku();

	vint X,Y,Z,W;
	
	vint latte;
	latte.pb(dot(cross(A,B,D),cross(A,B,C)));
	latte.pb(dot(cross(B,C,D),cross(B,C,A)));
	latte.pb(dot(cross(C,A,D),cross(C,A,B)));
	sort(all(latte));
	if(latte[0]>0||latte[2]<0)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}