|Codeforces Round #283 (Div. 1)|
There are two polygons on the plane, A and B. Polygon A rotates around point P, and polygon B rotates around point Q. Each polygon rotates with the constant rotational speed in the clockwise direction around its point, the rotational speed values of the polygons' rotation are equal.
Your task is to determine if there will be a collision between polygons. A collision is a situation when the polygons have at least one common point.
It is guaranteed that at the moment 0 the polygons A and B do not intersect and no polygon is fully contained inside another one.
The first line contains space-separated coordinates of point P.
The second line contains a single integer n (3 ≤ n ≤ 1000) — the number of vertices of polygon A.
Each of the next n lines contains two space-separated integers — the coordinates of the corresponding vertex of polygon A.
The next line is empty.
Then follow space-separated coordinates of point Q.
The next line contains a single integer m (3 ≤ m ≤ 1000) — the number of vertices of polygon B. Next m lines contain the coordinates of the vertices of the polygon B.
The vertices of both polygons are listed in the counterclockwise order. Coordinates of all points are integers, their absolute values don't exceed 104.
Print "YES", if the collision takes place and "NO" otherwise (don't print the quotes).
A polygon is a closed polyline that doesn't intersect itself and doesn't touch itself.
Picture to the first sample: