아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Symmetry

시간 제한8초메모리 제한512 MB

요약
단순 다각형을 이루는 N개의 점이 순서와 무관하게 주어질 때, 이들을 적절히 정렬해 선대칭 다각형을 만들 수 있는지 판정한다.
난이도

보통10점 중 7점

유형
기하, 정렬, 구현, 그리디
정답자
아직 제출이 없습니다

문제

Open Binary and Object Group organizes a programming contest every year. Mr. Hex belongs to this group and joins the judge team of the contest. This year, he created a geometric problem with its solution for the contest. The problem required a set of points forming a line-symmetric polygon for the input. Preparing the input for this problem was also his task. The input was expected to cover all edge cases, so he spent much time and attention to make them satisfactory.

However, since he worked with lots of care and for a long time, he got tired before he finished. So He might have made mistakes - there might be polygons not meeting the condition. It was not reasonable to prepare the input again from scratch. The judge team thus decided to find all line-asymmetric polygons in his input and fix them as soon as possible. They asked a programmer, just you, to write a program to find incorrect polygons.

You can assume the following:

  • Edges of the polygon must not cross or touch each other except for the end points of adjacent edges.
  • It is acceptable for the polygon to have adjacent three vertexes on a line, but in such a case, there must be the vertex symmetric to each of them.

입력

The input consists of a set of points in the following format.

N
x1 y1
x2 y2
...
xN yN

The first line of the input contains an integer N (3 ≤ N ≤ 1000), which denotes the number of points. The following N lines describe each point. The i-th line contains two integers x1, y1 (-10000 ≤ xi, yi ≤ 10000), which denote the coordinates of the i-th point.

Note that, although the points are the vertexes of a polygon, they are given in an artibrary order, not necessarily clockwise or counterclockwise.

출력

Output "Yes" in a line if the points can form a line-symmetric polygon, otherwise output "No".

예제5

  1. 예제 1

    입력
    4
    0 1
    1 0
    0 0
    1 1
    
    예상 출력
    Yes
    
  2. 예제 2

    입력
    4
    0 1
    1 -1
    0 0
    1 1
    
    예상 출력
    No
    
  3. 예제 3

    입력
    9
    -1 1
    0 1
    1 1
    -1 0
    0 0
    1 0
    -1 -1
    0 -1
    1 -1
    
    예상 출력
    No
    
  4. 예제 4

    입력
    3
    -1 -1
    0 0
    1 1
    
    예상 출력
    No
    
  5. 예제 5

    입력
    4
    0 2
    0 0
    -1 0
    1 0
    
    예상 출력
    Yes