There is a triangle formed by three points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ on a plain.

Write a program which prints "YES" if a point $P$ $(x_p, y_p)$ is in the triangle and "NO" if not.

Constraints

You can assume that:

* $ -100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_p, y_p \leq 100$
* 1.0 $\leq$ Length of each side of a tringle
* 0.001 $\leq$ Distance between $P$ and each side of a triangle

Input

Input consists of several datasets. Each dataset consists of:

$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_p$ $y_p$


All the input are real numbers. Input ends with EOF. The number of datasets is less than or equal to 100.

Output

For each dataset, print "YES" or "NO" in a line.

Example

Input

0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5
0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0


Output

YES
NO

import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
	private static final int X = 0;
	private static final int Y = 1;
	
	private static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args) {
		ArrayList<Double> p1 = new ArrayList<Double>(2);
		ArrayList<Double> p2 = new ArrayList<Double>(2);
		ArrayList<Double> p3 = new ArrayList<Double>(2);
		ArrayList<Double> pTarget = new ArrayList<Double>(2);
		
		ArrayList<Boolean> results = new ArrayList<Boolean>();
		
		try{
			while(true){
				setInputs(p1, p2, p3, pTarget);
		
				ArrayList<Double> cog = getCenterOfGravity(p1, p2, p3);  
		
				results.add(isInTriangle(p1, p2, p3, cog, pTarget));
				
				p1.clear();
				p2.clear();
				p3.clear();
				pTarget.clear();
				cog.clear();
			}
		}catch(NoSuchElementException e){
			//½àµÈ¢
		}
		
		for(int i = 0; i < results.size(); i++){
			printIsInTriangle(results.get(i));
		}
	}
	
	private static void printIsInTriangle(boolean isInTriangle){
		String result;
		if(isInTriangle){
			result = "YES";
		}
		else{
			result = "NO";
		}
		System.out.println(result);
	}
	
	private static boolean isInTriangle(
			ArrayList<Double> p1,
			ArrayList<Double> p2,
			ArrayList<Double> p3,
			ArrayList<Double> cog,
			ArrayList<Double> pTarget){
		//¼üp1,p2Æ¼üpTarget,cogªð··éêApTargetÍOp`p1p2p3ÌO
		if(isInBiggerArea(p1, p2, pTarget) && !(isInBiggerArea(p1, p2, cog))){
			return false;
		}
		if(!(isInBiggerArea(p1, p2, pTarget)) && isInBiggerArea(p1, p2, cog)){
			return false;
		}
		
		//¼üp2,p3Æ¼üpTarget,cogªð··éêApTargetÍOp`p1p2p3ÌO
		if(isInBiggerArea(p2, p3, pTarget) && !(isInBiggerArea(p2, p3, cog))){
			return false;
		}
		if(!(isInBiggerArea(p2, p3, pTarget)) && isInBiggerArea(p2, p3, cog)){
			return false;
		}
		
		//¼üp1,p3Æ¼üpTarget,cogªð··éêApTargetÍOp`p1p2p3ÌO
		if(isInBiggerArea(p1, p3, pTarget) && !(isInBiggerArea(p1, p3, cog))){
			return false;
		}
		if(!(isInBiggerArea(p1, p3, pTarget)) && isInBiggerArea(p1, p3, cog)){
			return false;
		}
		
		return true;
	}
	
	private static boolean isInBiggerArea(
			ArrayList<Double> p1,
			ArrayList<Double> p2,
			ArrayList<Double> p3){
		double result = (p3.get(Y) - p1.get(Y)) * (p2.get(X) - p1.get(X)) + (p2.get(Y) - p1.get(Y)) * (p1.get(X) - p3.get(X));
		if(result > 0){
			return true;
		}
		else{
			return false;
		}
	}
	
	private static ArrayList<Double> getCenterOfGravity(
			ArrayList<Double> p1,
			ArrayList<Double> p2,
			ArrayList<Double> p3){
		ArrayList<Double> cog = new ArrayList<Double>(2);
		cog.add((p1.get(X) + p2.get(X) + p3.get(X)) / 3);
		cog.add((p1.get(Y) + p2.get(Y) + p3.get(Y)) / 3);
		return cog;
	}
	
	private static void setInputs(
			ArrayList<Double> p1,
			ArrayList<Double> p2,
			ArrayList<Double> p3,
			ArrayList<Double> p4){
		p1.add(sc.nextDouble());
		p1.add(sc.nextDouble());
		p2.add(sc.nextDouble());
		p2.add(sc.nextDouble());
		p3.add(sc.nextDouble());
		p3.add(sc.nextDouble());
		p4.add(sc.nextDouble());
		p4.add(sc.nextDouble());
	}
}