import java.io.*; import java.util.*; class Main { static double sq(double[]x){ double sq=0; for(int i=0;i<3;++i)sq+=x[i]*x[i]; return sq; } static double inn(double[]x,double[]y){ double sq=0; for(int i=0;i<3;++i)sq+=x[i]*y[i]; return sq; } public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); double[]a=new double[3],b=new double[3],c=new double[3],d=new double[3]; ; for(int i=0;i<3;++i)a[i]=sc.nextDouble(); for(int i=0;i<3;++i)b[i]=sc.nextDouble()-a[i]; for(int i=0;i<3;++i)c[i]=sc.nextDouble()-a[i]; for(int i=0;i<3;++i)d[i]=sc.nextDouble()-a[i]; double bb=sq(b),bc=inn(b,c),cc=sq(c); double det=bb*cc-bc*bc; double db=inn(d,b),dc=inn(d,c); double x=(cc*db-bc*dc)/det,y=(-bc*db+bb*dc)/det; out.println((x>=0&&y>=0&&x+y<=1)?"YES":"NO"); out.close(); } // http://codeforces.com/blog/entry/7018 //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyScanner class for faster input---------- public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine(){ String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }