E. Snowfake
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Snowflakes often appear to have six-fold radial symmetry due to the hexagonal crystalline structure of ice. C.C., amazed by this fact, collects the most interesting snowflakes she can find across UT. Examining them with a microscope, she finds certain rare ones break this six-fold symmetry. Help her identify these snowfakes!

C.C. maps the snowflake's vertices onto a unique coordinate grid, with the snowflake centered at the origin $$$(0,0)$$$. Rather than the traditional Cartesian grid, she uses two unit vectors separated by an angle of $$$60^\circ$$$:

  • $$$\mathbf{e_1}$$$ lies along the positive x-axis.
  • $$$\mathbf{e_2}$$$ is rotated $$$60^\circ$$$ counter-clockwise from $$$\mathbf{e_1}$$$.

A point recorded as $$$(u, v)$$$ represents the position $$$u \cdot \mathbf{e_1} + v \cdot \mathbf{e_2}$$$. This grid lends itself to the nature of snowflakes—all points can be represented with integer coordinates!

A snowflake is considered perfect if rotating the set of points by $$$60^\circ$$$ around the origin results in the exact same set of points. Given $$$1 \le N \le 10^5$$$ points, determine if C.C. has found a perfect snowflake.

Input

The first line of input contains an integer $$$N$$$ ($$$1 \le N \le 10^5$$$) — the number of vertices in the snowflake.

Each of the next $$$N$$$ lines contains two integers $$$u_i$$$ and $$$v_i$$$ ($$$-10^9 \le u_i, v_i \le 10^9$$$) — the coordinates of the $$$i$$$-th vertex in C.C.'s grid system. It is guaranteed that all $$$N$$$ points are distinct.

Output

Print a single line containing the string "YES" if the snowflake is perfect (i.e., it has 6-fold rotational symmetry about the origin), or "NO" otherwise.

Examples
Input
7
0 0
2 1
-1 3
-3 2
-2 -1
1 -2
3 -2
Output
NO
Input
7
0 0
2 1
-1 3
-3 2
-2 -1
1 -3
3 -2
Output
YES
Note

The purple points below describe the first test case's not perfect snowflake. The vectors $$$\mathbf{e_1}$$$ and $$$\mathbf{e_2}$$$ are shown in red and blue, respectively.