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

~/algor $ cat problems/massiv-osuvchimi

Is the array increasing?

Easy 1000 ms 128 MB 29%
Share

A positive integer $n$ and an array of $n$ integers are given. If the array elements are strictly increasing, print YES, otherwise NO (an array of one element is considered increasing):

$$a_{1} \lt a_{2} \lt \dots \lt a_{n}$$

Checking that the array elements are in strictly increasing order

Input

The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.

Output

YES or NO accordingly.

Note

$1 \le n \le 10^{4}$
$-1000 \le a_{i} \le 1000$

Examples

Input #1
5
1 3 4 8 10
Output #1
YES
Input #2
4
1 2 2 3
Output #2
NO

Sign in to submit a solution

Signing up is free and takes a minute.