Check Non-Decreasing

JavaScript Easy 4 views
Back to Questions

Problem Description

Array diya hai. Check karo whether it is non-decreasing (every next element is >= previous). Print YES or NO.

Input Format

One line: n then n integers.

Output Format

YES or NO.

Sample Test Case

Input:
5 1 2 2 7 9
Output:
YES

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next