#include using lint=long long; using real=long double; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); auto cross=[&](auto&&a,auto&&b){ std::vectorc(3); for(lint i=0;i<3;i++){ lint j=(i+1)%3,k=(i+2)%3; c.at(i)=a.at(j)*b.at(k)-a.at(k)*b.at(j); } return c; }; auto dot=[&](auto&&a,auto&&b){ return std::inner_product(a.begin(),a.end(),b.begin(),0ll); }; auto sub=[&](auto&&a,auto&&b){ std::vectorc(3); for(lint i=0;i<3;i++)c.at(i)=a.at(i)-b.at(i); return c; }; std::vector>a(3,std::vector(3)); for(auto&&v:a)for(lint&x:v)std::cin>>x; std::vectorb(3); for(lint&x:b)std::cin>>x; for(lint i=0;i<3;i++){ if(dot( cross(sub(a.at(2),a.at(0)),sub(a.at(2),a.at(1))), cross(sub(b,a.at(0)),sub(b,a.at(1))))<0) { std::cout<<"NO"<<'\n'; return 0; } std::rotate(a.begin(),a.begin()+1,a.end()); } std::cout<<"YES"<<'\n'; }