// Arup Guha
// 4/10/20
// Russell
import java.util.*;

public class russell {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		while (stdin.hasNext()) {
	
			v3D[] planepts = new v3D[3];
			for (int i=0; i<3; i++) {
				double x = stdin.nextDouble();
				double y = stdin.nextDouble();
				double z = stdin.nextDouble();
				planepts[i] = new v3D(x,y,z);
			}	

			v3D[] linepts = new v3D[2];
			for (int i=0; i<2; i++) {
				double x = stdin.nextDouble();
				double y = stdin.nextDouble();
				double z = stdin.nextDouble();
				linepts[i] = new v3D(x,y,z);
			}
			
			v3D linedir = linepts[0].to(linepts[1]);			
		
			v3D v1 = planepts[0].to(planepts[1]);
			v3D v2 = planepts[0].to(planepts[2]);
			v3D normal = v1.cross(v2);
			double D = normal.dot(planepts[0]);
			double eqnC = normal.dot(linepts[0]);
			double lambdaCoeff = normal.dot(linedir);
			
			boolean res = true;
			
			if (Math.abs(lambdaCoeff) > 1e-9) {
				double lambda = (D-1.0*eqnC)/lambdaCoeff;
 		
				if (lambda > 0 && lambda < 1) {
				
					double x = linepts[0].x + lambda*linedir.x;
					double y = linepts[0].y + lambda*linedir.y;
					double z = linepts[0].z + lambda*linedir.z;
					v3D crossPt = new v3D(x,y,z);
				
					// Now, we need to know if this point's in the triangle or not.
					v3D triv1 = crossPt.to(planepts[0]);
					v3D triv2 = crossPt.to(planepts[1]);
					v3D triv3 = crossPt.to(planepts[2]);
					double a1 = triv1.angle(triv2);
					double a2 = triv1.angle(triv3);
					double a3 = triv2.angle(triv3);
					double sumA = a1+a2+a3;
				
					if (Math.abs(sumA-2*Math.PI) < 1e-6)
						res = false;
				}
			}

			if (res)
				System.out.println("Yes");
			else
				System.out.println("No");
		}
	}
}

class v3D {
	public double x;
	public double y;
	public double z;
	
	public v3D(double myx, double myy, double myz) {
		x = myx;
		y = myy;
		z = myz;
	}
	
	public String toString() {
		return "("+x+" "+y+" "+z+")";
	}
	
	public double dot(v3D other) {
		return x*other.x + y*other.y + z*other.z;
	}
	
	public v3D cross(v3D other) {
		return new v3D(y*other.z-other.y*z, z*other.x-other.z*x, x*other.y-other.x*y);
	}
	
	public v3D to(v3D other) {
		return new v3D(other.x-x,other.y-y,other.z-z);
	}
	
	public double mag() {
		return Math.sqrt(x*x+y*y+z*z);
	}
	
	// Returns the angle between vector this and vector other.
	public double angle(v3D other) {
		double mydot = this.dot(other);
		mydot /= mag();
		mydot /= other.mag();
		return Math.acos(mydot);
	}
}