Question
Check Non Decreasing Number
A number is called a non-decreasing number if every digit from left to right is greater than or equal to the previous digit. Given a number n, determine whether it satisfies this property.
Input
A single integer n.
Output
Print "Yes" if the number is non-decreasing, otherwise print "No".
Example
Example 1:
Input:
1234
Output:
Yes
Example 2:
Input:
132
Output:
No
Example 3:
Input:
11
Output:
Yes
Explanation:
1. 1234: 1 ≤ 2 ≤ 3 ≤ 4 ✔ → Yes
2. 132: 1 ≤ 3 ✔, but 3 > 2 ❌ → No
3. 11: 1 ≤ 1 ✔ → Yes
Input:
1234
Output:
Yes
Example 2:
Input:
132
Output:
No
Example 3:
Input:
11
Output:
Yes
Explanation:
1. 1234: 1 ≤ 2 ≤ 3 ≤ 4 ✔ → Yes
2. 132: 1 ≤ 3 ✔, but 3 > 2 ❌ → No
3. 11: 1 ≤ 1 ✔ → Yes