Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/kollinear-nuqtalar

Points on one line

Easy 1000 ms 128 MB 22%
Share

$n$ points are given on the plane (some may coincide). Do all of them lie on one line? If so, print YES, otherwise print NO. One or two points always lie on one line.

Points on the coordinate plane and the line passing through all of them

Input

The first line contains a positive integer $n$. Each of the next $n$ lines contains two integers: $x_{i}$ and $y_{i}$.

Output

YES or NO.

Note

$1 \le n \le 10^{5}$
$-10^{9} \le x_{i}, y_{i} \le 10^{9}$

Examples

Input #1
4
1 1
3 2
-1 0
7 4
Output #1
YES
Input #2
3
0 0
2 2
3 2
Output #2
NO

Sign in to submit a solution

Signing up is free and takes a minute.