Silver chain#9058

Silver chain

1 second
128 megabytes
Medium

You are given two chains, each represented as a closed polygonal line composed of segments. The first chain is a reference chain with a fixed shape, and the second chain is your own, lying in front of you.

You wonder whether you can arrange your chain so that it exactly matches the shape of the reference chain, including covering every segment the same number of times. You are allowed to bend your chain at any points, not just at the ends of the segments.

The polygonal lines may have self-intersections, segments of zero length, and overlapping segments.

Input

The first line contains one integer (3 \leq n \leq 1000) — the number of vertices of the reference chain's polygonal line. The next lines contain the coordinates of the vertices of the first polygonal line in order: x_i, y_i (|x_i|, |y_i| \leq 1000).

The following line contains one integer (3 \leq m \leq 1000) — the number of vertices of the polygonal line representing your chain. The next lines contain the coordinates of the vertices of the second polygonal line in order: x_i, y_i (|x_i|, |y_i| \leq 1000).

Output

On a single line, print "Yes" if you can arrange your chain to be exactly like the reference chain. Otherwise, print "No".

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading