Codeforces Round 431 (Div. 2)
B
Tell Your World
Codeforces
1600
原题
← AC →
翻译中…

Connect the countless points with lines, till we reach the faraway yonder.

翻译中…

There are $*n*$ points on a coordinate plane, the $*i*$-th of which being $(*i*, *y*_{*i*})$.

翻译中…

Determine whether it's possible to draw two parallel and non-overlapping lines, such that every point in the set lies on exactly one of them, and each of them passes through at least one point in the set.

翻译中…

Input

翻译中…

The first line of input contains a positive integer $*n*$ ($3 ≤ *n* ≤ 1 000$) — the number of points.

翻译中…

The second line contains $*n*$ space-separated integers $*y*_{1}, *y*_{2}, ..., *y*_{*n*}$ ($- 10^{9} ≤ *y*_{*i*} ≤ 10^{9}$) — the vertical coordinates of each point.

翻译中…

Output

翻译中…

Output "Yes" (without quotes) if it's possible to fulfill the requirements, and "No" otherwise.

翻译中…

You can print each letter in any case (upper or lower).

翻译中…

Note

翻译中…

In the first example, there are five points: $(1, 7)$, $(2, 5)$, $(3, 8)$, $(4, 6)$ and $(5, 9)$. It's possible to draw a line that passes through points $1, 3, 5$, and another one that passes through points $2, 4$ and is parallel to the first one.

翻译中…

In the second example, while it's possible to draw two lines that cover all points, they cannot be made parallel.

翻译中…

In the third example, it's impossible to satisfy both requirements at the same time.

翻译中…

样例

Input #1
5
7 5 8 6 9
Output #1
Yes
InputCopy OutputCopy
Input #2
5
-1 -2 0 0 -5
Output #2
No
InputCopy OutputCopy
Input #3
5
5 4 3 2 1
Output #3
No
InputCopy OutputCopy
Input #4
5
1000000000 0 0 0 0
Output #4
Yes
InputCopy OutputCopy
题目信息
题号
849B
时间限制
1 s
内存限制
256 MB
标签
暴力
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。