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
E = 10**-10

def cp(a, b):
    c = [a[1]*b[2] - a[2]*b[1],
        a[2]*b[0] - a[0]*b[2],
        a[0]*b[1] - a[1]*b[0]]
    return c

while True:
    try:
        x1,y1,x2,y2,x3,y3,xp,yp = [float(i) for i in input().split()]
        ax = x3-x1
        ay = y3-y1
        bx = x1-x2
        by = y1-y2
        cx = x2-x3
        cy = y2-y3
        pax = xp-x1
        pay = yp-y1
        pbx = xp-x2
        pby = yp-y2
        pcx = xp-x3
        pcy = yp-y3
        ca = [bx,by,0]
        ab = [cx,cy,0]
        bc = [ax,ay,0]
        pa = [pax,pay,0]
        pb = [pbx,pby,0]
        pc = [pcx,pcy,0]
        cp1 = cp(ca,pa)[2]
        cp2 = cp(ab,pb)[2]
        cp3 = cp(bc,pc)[2]
        if abs(cp1 - abs(cp1)) < E:
            sig1 = 1
        elif abs(cp1 + abs(cp1)) < E:
            sig1 = -1
        if abs(cp2 - abs(cp2)) < E:
            sig2 = 1
        elif abs(cp2 + abs(cp2)) < E:
            sig2 = -1
        if abs(cp3 - abs(cp3)) < E:
            sig3 = 1
        elif abs(cp3 + abs(cp3)) < E:
            sig3 = -1
        if abs(sig1 + sig2 + sig3) == 3:
            print('YES')
        else:
            print('NO')
    except EOFError:
        break


