Problem Statement
Write a C program to check if a 1D array is sorted in ascending order. The array is sorted if every element is less than or equal to the next element. Output "YES" if sorted, otherwise "NO".
Example 1
Input:
5 1 2 3 4 5
Output:
YES
Example 2
Input:
5 1 3 2 4 5
Output:
NO