051. The Convergence of Two Tetra-sided Polygons, Known as Rectangles
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You will be given two opposite corners of two separate rectangles and you must determine whether they intersect or not.

Input

The first line will contain 4 integers separated by spaces, which respectively represent the x-coordinate and y-coordinate of a corner of the rectangle and the x-coordinate and y-coordinate of the opposite corner. The second line will contain another 4 integers that represent the same coordinates but for the second rectangle.

Output

Print "YES" (without the quotes) if the rectangles intersect or "NO" (without the quotes) if the rectangles do not intersect.

Example
Input
-5 -5 5 5
4 4 8 8
Output
YES
Note

The first rectangle has one corner located at (-5,-5) and the opposite corner at (5,5). The second rectangle has one corner located at (4,4) and the opposite corner at (8,8). These rectangles intersect, thus "YES" is printed

Also, if the rectangles lie on top of one another, they are intersecting. If one is inside the other and their perimeters do not touch, then they are not intersecting.