The intersection of two segments#2139

The intersection of two segments

1 second
64 megabytes
Easy

Determine whether two line segments intersect.

Input

Eight numbers — the coordinates of the endpoints of two segments. All input data are integers not exceeding by absolute value.

Output

Print YES if the segments intersect, and NO otherwise.

Examples

Example 1

Loading
Loading