#P1299B. Aerodynamic
Aerodynamic
No submission language available for this problem.
Description
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon which is defined by coordinates of its vertices. Define as a polygon obtained by translating by vector . The picture below depicts an example of the translation:
Define as a set of points which is the union of all such that the origin lies in (both strictly inside and on the boundary). There is also an equivalent definition: a point lies in only if there are two points in such that . One can prove is a polygon too. For example, if is a regular triangle then is a regular hexagon. At the picture below is drawn in black and some which contain the origin are drawn in colored:
The spaceship has the best aerodynamic performance if and are similar. Your task is to check whether the polygons and are similar.
The first line of input will contain a single integer () — the number of points.
The -th of the next lines contains two integers (), denoting the coordinates of the -th vertex.
It is guaranteed that these points are listed in counterclockwise order and these points form a strictly convex polygon.
Output "YES" in a separate line, if and are similar. Otherwise, output "NO" in a separate line. You can print each letter in any case (upper or lower).
Input
The first line of input will contain a single integer () — the number of points.
The -th of the next lines contains two integers (), denoting the coordinates of the -th vertex.
It is guaranteed that these points are listed in counterclockwise order and these points form a strictly convex polygon.
Output
Output "YES" in a separate line, if and are similar. Otherwise, output "NO" in a separate line. You can print each letter in any case (upper or lower).
Samples
Note
The following image shows the first sample: both and are squares. The second sample was shown in the statements.