eolymp
bolt
Try our new interface for solving problems
Problems

Convex polygon

Convex polygon

Determine whether a given polygon is convex. \InputFile The first line of one number - \textbf{N} (\textbf{3} ≤ \textbf{N} ≤ \textbf{100000}). Next \textbf{N} lines in a pair of numbers - the coordinates of another vertex simple polygon in order to circumvent or counterclockwise. All coordinates are integers modulo not exceeding \textbf{10000}. \OutputFile One line of "\textbf{YES}", if given polygon is convex, and "\textbf{NO}" otherwise.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
0 0
0 1
1 0
Output example #1
YES