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.*;
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws IOException{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		while(true){
			Point tri[] = new Point[3];
			for(int i = 0; i < 3; i++){
				tri[i] = new Point();
			}
			Point s = new Point();
			s.x = 1.0;
			s.y = 0.0;
			
			int n = 8;
			String c = br.readLine();
			if(c.equals(""))break;
			
			for(int i = 0; i < 8; i++){
				if(c.indexOf(" ") !=  -1){
					String str = c.substring(0, c.indexOf(" "));
					if(i < 6){
						if(i%2==0){
							tri[i/2].x = Double.parseDouble(str);
						}
						else
							tri[i/2].y = Double.parseDouble(str);
						c = c.substring(c.indexOf(" ") + 1);
					}

					else{
						s.x = Double.parseDouble(str);
						c = c.substring(c.indexOf(" ") + 1);
					}
				}
				else{
					s.y = Double.parseDouble(c);
				}
			}
			
			boolean f = true;
			boolean gyaku = false;
			for(int i = 0; i < 3; i++){
				if(!tri[(i+2)%3].isLeft(tri[i%3],tri[(i+1)%3])){
					gyaku = true;
					break;
				}
				if(!s.isLeft(tri[i],tri[(i+1)%3])){
					f = false;
				}
			}

			if(gyaku){
				for(int i = 2; i >= 0; i--){
					/*if(!tri[(i+1)%3].isLeft(tri[i],tri[i%3])){
						System.out.println("gyaku break");	
						break;
					}*/

					if(!s.isLeft(tri[i], tri[(i+2)%3])){
						f = false;
					}
				}
			}
				if(f)
					System.out.println("YES");
				else
				System.out.println("NO");
			
			
			
		}
	}
}

final class Point{
	public double x;
	public double y;

	public boolean isLeft(Point p, Point q) {
	// ÀµÄ­¾³¢
	// xNg p -> q ÆxNg p -> this Ì¬·½slÓ`Ì
	// tÊÏª³ÈçÎ true »¤ÅÈ¯êÎfalse ðÔ·B
	// tÊÏÌvZÉÍºÌ\bh signedArea ðp¢éB

	// xNgp -> qÍ(q.x-p.x , q.y-p.y)Å è
	// xNgp -> thisÍ(this.x-p.x , this.y-p.y)Å é
	// ±ÌñÂÌxNgª¬·½slÓ`ÌtÊÏðvZµÄ
	// »êª³ÈçtrueAÈçÎfalseðÔ·
	if(signedArea(q.x-p.x, q.y-p.y, this.x-p.x, this.y-p.y) > 0){
		return true;
	}
	else
		return false;
	}
	public double signedArea(double x1, double y1, double x2, double y2) {
	return x1 * y2 - x2 * y1;
	}


	}