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.io.BufferedReader;
import java.io.InputStreamReader;

//public class Problem0012_APointInaTriangle {
public class Main {
	public static void main(String[] args) {
		try {
		//	Problem0012_APointInaTriangle test = new Problem0012_APointInaTriangle();
			Main test = new Main();
			
			
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String line;
			while((line = reader.readLine()) != null) {
				try {
					String[] textArray = line.split(" ");
					double[] numbers = new double[textArray.length];
					
					for(int i = 0; i < textArray.length; i++) {
						numbers[i] = Double.parseDouble(textArray[i]);
					}
					test.showAnswer(numbers);
				} catch(NumberFormatException e) {
					break;
				}
			}
			
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	//s() + t() = () (0<= s+t <= 1) ðzè(½¾µA()Í_Ì·Ùð\·xNg)
	void showAnswer(double[] array) {
		double[][] vector = getVector(array, 0, 2, 4);
		double[] position = {array[6] - array[0], array[7] - array[1]};
		if(vector[0][0] * vector[1][1] - vector[0][1] * vector[1][0] == 0) {
			vector = getVector(array, 2, 4, 0);
			position[0] = array[6] - array[2];
			position[1] = array[7] - array[3];
		}
		
	//	System.out.println("00:" + vector[0][0] + "\t01:" + vector[0][1]  + "\t10:" + vector[1][0] + "\t11:" + vector[1][1] + "\tA:" + position[0] + "\tB:" + position[1]);
		double s = (position[0] * vector[1][1] - position[1] * vector[1][0]) / (vector[0][0] * vector[1][1] - vector[0][1] * vector[1][0]);
	//	System.out.println("s:" + s);
		double t;
		if(vector[1][0] != 0) {
			t = (position[0] - vector[0][0] * s) / vector[1][0];
		} else if(vector[1][1] != 0) {	//¼û[Ì¯ê_  è¾È¢
			t = (position[1] - vector[0][1] * s) / vector[1][1];
		} else {
			System.out.println("NO");
			return;
		}
	//	System.out.println("t:" + t); 
		if(0 < s && 0 < t && s + t < 1) {	//1or0 Ì Ó¨æÑ¸_  è¾È¢
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
	double[][] getVector(double[] array, int origin, int first, int second) {
		double[][] result = new double[2][2];
		
		for(int i = 0; i < 2; i++) {
			result[0][i] = array[first + i] - array[origin + i];
			result[1][i] = array[second + i] - array[origin + i];
		}
		
		return result;
	}
}