Check the order

Report a typo

Write a program that checks if N numbers are sorted according to the ascending order (from the smallest number to the largest one).


The first line contains the number N.
The other lines contain N numbers.

Output "YES" if N numbers are sorted in ascending order, otherwise, output "NO".

Sample Input 1:

4
1
2
3
4

Sample Output 1:

YES

Sample Input 2:

4
1
2
3
0

Sample Output 2:

NO
Write a program in Kotlin
fun main() {
// write your code here
}
___

Create a free account to access the full topic