Geometry
Geometry-01
Geometry-02
Geometry-03
~/algor $ cat problems/kollinear-nuqtalar
Points on one line
Easy
1000 ms
128 MB
22%
$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.
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