We’re preparing your current view and syncing the latest data.
You are given an array of n integers. Your task is to determine whether it is possible to sort the entire array in non-decreasing order by reversing exactly one continuous segment of the array. If yes, output 'yes' and the 1-based indices of the segment to reverse. Otherwise, output 'no'.
The first line contains a single integer n (1 ≤ n ≤ 10^5) — the number of elements in the array. The second line contains n integers a1, a2, ..., an (−10^9 ≤ ai ≤ 10^9) — the elements of the array.
If it is possible to sort the array by reversing exactly one continuous segment, print "yes" in the first line. In the second line, print two integers l and r (1 ≤ l ≤ r ≤ n) — the bounds of the segment to reverse. If there are multiple solutions, print any. If it is not possible, print "no".
1 ≤ n ≤ 10^5 −10^9 ≤ ai ≤ 10^9
Example 1
Input
4 2 1 3 4
Output
yes 1 2
Explanation
Reversing the segment from index 1 to 2 (1-based) results in the sorted array [1, 2, 3, 4].
Example 2
Input
3 3 2 1
Output
yes 1 3
Explanation
Reversing the entire array sorts it as [1, 2, 3].
Example 3
Input
5 1 5 3 3 3
Output
yes 2 5
Explanation
Reversing the segment from index 2 to 5 sorts the array as [1, 3, 3, 3, 5].
Example 4
Input
3 1 3 2
Output
yes 2 3
Explanation
Reversing the last two elements results in [1, 2, 3].
Example 5
Input
4 4 3 2 1
Output
yes 1 4
Explanation
Reversing the entire array sorts it.