eolymp
bolt
Try our new interface for solving problems
Problems

Segments intersection

Segments intersection

Time limit 1 second
Memory limit 128 MiB

Two segments are given in the plane with integer coordinates of its endpoints in Cartesian coordinate system. Determine whether they intersect (have a common point).

Input data

The first line contains the coordinates of the first endpoint of the first segment, the second line - the second endpoint of the first segment. The third and fourth lines - the corresponding coordinates of the second segment. The coordinates are integer, their absolute value do not exceed 10000.

Output data

Print the word "Yes", if segments have common point, or "No" otherwise.

prb839.gif

Examples

Input example #1
0 0
1 0
1 0
1 1
Output example #1
Yes
Input example #2
0 0
1 0
2 0
3 0
Output example #2
No