Do the segments intersect - 1#6345

Do the segments intersect - 1

1 secondo
64 megabyte
Facile

Given four points , , , and such that no three of these points are collinear.

Determine whether the line segments and intersect.

Input

The input consists of exactly three groups. Each group contains two lines (a total of six lines in the input). The first line of each group provides the coordinates of segment in the format: A_x A_y B_x B_y. The second line of each group provides the coordinates of segment in the format: C_x C_y D_x D_y. All coordinates are integers, with absolute values not exceeding 10^6.

Output

For each group, output YES on a separate line if the segments intersect, and NO otherwise.

Esempi

Esempio 1

Loading
Loading