Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers.

Unfortunately, the size of a is too small. You want a bigger array! Your friends agree to give you a bigger array, but only if you are able to answer the following question correctly: is it possible to sort the array a (in increasing order) by reversing exactly one segment of a? See definitions of segment and reversing in the notes.


-----Input-----

The first line of the input contains an integer n (1 ≤ n ≤ 10^5) — the size of array a.

The second line contains n distinct space-separated integers: a[1], a[2], ..., a[n] (1 ≤ a[i] ≤ 10^9).


-----Output-----

Print "yes" or "no" (without quotes), depending on the answer.

If your answer is "yes", then also print two space-separated integers denoting start and end (start must not be greater than end) indices of the segment to be reversed. If there are multiple ways of selecting these indices, print any of them.


-----Examples-----
Input
3
3 2 1

Output
yes
1 3

Input
4
2 1 3 4

Output
yes
1 2

Input
4
3 1 2 4

Output
no

Input
2
1 2

Output
yes
1 1



-----Note-----

Sample 1. You can reverse the entire array to get [1, 2, 3], which is sorted.

Sample 3. No segment can be reversed such that the array will be sorted.

Definitions

A segment [l, r] of array a is the sequence a[l], a[l + 1], ..., a[r].

If you have an array a of size n and you reverse its segment [l, r], the array will become:

a[1], a[2], ..., a[l - 2], a[l - 1], a[r], a[r - 1], ..., a[l + 1], a[l], a[r + 1], a[r + 2], ..., a[n - 1], a[n].

Difficulty: EASY

Solutions:
n = int(input())
l = list(map(int, input().split()))
c = sorted(l.copy())
x = -1
for i in range(n):
	if l[i] != c[i]:
		x = i
		break
y = -1
for i in range(n - 1, -1, -1):
	if l[i] != c[i]:
		y = i
		break
if x == -1 and y == -1:
	print('yes')
	print(1, 1)
else:
	l[x:y + 1] = reversed(l[x:y + 1])
	flag = 0
	for (i, j) in zip(l, c):
		if i != j:
			print('no')
			flag = 1
			break
	if flag == 0:
		print('yes')
		print(x + 1, y + 1)


n = int(input())
temparr = input()
temparr = temparr.split()
arr = []
for i in temparr:
	arr.append(int(i))
carr = sorted(arr)
count = 0
diff = []
for i in range(n):
	if arr[i] != carr[i]:
		diff.append(i)
if len(diff) == 0:
	print('yes')
	print('1 1')
else:
	start = diff[0]
	end = diff[-1]
	newarr = arr[start:end + 1]
	newarr = newarr[::-1]
	index = 0
	for i in range(n):
		if i >= start and i <= end:
			arr[i] = newarr[index]
			index += 1
	flag = 0
	for i in range(n):
		if arr[i] != carr[i]:
			flag = 1
			diff.append(i)
	if flag == 1:
		print('no')
	else:
		print('yes')
		startindex = start + 1
		endindex = end + 1
		print(str(startindex) + ' ' + str(endindex))


def func(n, arr):
	sortedArr = sorted(arr)
	l = -1
	r = -1
	for i in range(n):
		if arr[i] != sortedArr[i]:
			l = i
			break
	if l == -1:
		print('yes')
		print(1, 1)
		return
	for j in range(n - 1, -1, -1):
		if arr[j] != sortedArr[j]:
			r = j
			break
	low = l
	high = r
	while r >= l:
		(arr[l], arr[r]) = (arr[r], arr[l])
		l += 1
		r -= 1
	for k in range(n):
		if arr[k] != sortedArr[k]:
			print('no')
			return
	print('yes')
	print(low + 1, high + 1)
n = int(input())
arr = list(map(int, input().split()))
func(n, arr)


n = int(input())
numbers = list(map(int, input().split()))
i = 1
start = -1
end = -1
while i < len(numbers):
	if numbers[i] < numbers[i - 1]:
		start = i - 1
		while i < len(numbers) and numbers[i] < numbers[i - 1]:
			end = i
			i += 1
		break
	else:
		i += 1
if start != -1:
	if start != 0 and numbers[end] < numbers[start - 1]:
		print('no')
		exit(0)
	elif end < len(numbers) - 1 and numbers[start] > numbers[end + 1]:
		print('no')
		exit(0)
	while i < len(numbers):
		if numbers[i] < numbers[i - 1]:
			print('no')
			exit(0)
		i += 1
	print('yes')
	print(start + 1, end + 1)
else:
	print('yes\n1 1')


n = int(input())
a = list(map(int, list(input().split())))
a_sorted = sorted(a)
start = -1
end = -1
for i in range(n):
	if a[i] != a_sorted[i]:
		start = i
		break
	start = i
for i in range(n - 1, -1, -1):
	if a[i] != a_sorted[i]:
		end = i
		break
	end = i
if start > end:
	print('yes')
	print('1 1')
	exit(0)
if a[start:end + 1] == a_sorted[start:end + 1][::-1]:
	print('yes')
	print(start + 1, end + 1, sep=' ')
	exit(0)
print('no')
exit(0)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i = -1
while i + 1 < n and a[i + 1] == b[i + 1]:
	i += 1
j = n
while j > -1 and a[j - 1] == b[j - 1]:
	j -= 1
l = i + 1
r = j - 1
if l <= r:
	f = True
	for k in range(r - l + 1):
		f &= a[l + k] == b[r - k]
	print('no' if not f else 'yes\n%d %d' % (l + 1, r + 1))
else:
	print('yes\n1 1')


n = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)
z = []
if a == b:
	print('yes')
	print(1, 1)
else:
	for i in range(len(a)):
		if a[i] != b[i]:
			x = a.index(b[i])
			for j in range(x, i - 1, -1):
				z.append(a[j])
			for j in range(x + 1, len(a)):
				z.append(a[j])
			if z == b:
				print('yes')
				print(i + 1, x + 1)
				break
			else:
				print('no')
				break
		else:
			z.append(a[i])


n = int(input())
a = [int(x) for x in input().split()]
start = -1
end = n + 1
for i in range(1, n):
	if a[i] < a[i - 1]:
		start = i - 1
		break
for i in range(n - 2, -1, -1):
	if a[i] > a[i + 1]:
		end = i + 1
		break
if start == -1 and end == n + 1:
	print('yes')
	print('1 1')
else:
	a[start:end + 1] = a[start:end + 1][::-1]
	for i in range(1, n):
		if a[i] < a[i - 1]:
			print('no')
			break
	else:
		print('yes')
		print(start + 1, end + 1)


n = int(input())
array = [int(x) for x in input().split()]
arraySort = array.copy()
arraySort.sort()
tmp = []
for i in range(n - 1):
	if array[i] > array[i + 1]:
		tmp.append(i)
		break
for i in range(n - 1, 0, -1):
	if array[i] < array[i - 1]:
		tmp.append(i)
		break
aux = array.copy()
if len(tmp) == 2:
	biu = []
	for i in range(0, tmp[0]):
		biu.append(array[i])
	for i in range(tmp[1], tmp[0] - 1, -1):
		biu.append(array[i])
	for i in range(tmp[1] + 1, len(array)):
		biu.append(array[i])
	aux = biu.copy()
if aux == arraySort:
	print('yes')
	if len(tmp) < 2:
		print(1, 1)
	else:
		print('%d %d' % (tmp[0] + 1, tmp[1] + 1))
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
m = []
k = l.copy()
k.sort()
c = 0
s = 0
e = 0
for i in range(n):
	if l[i] != k[i]:
		s = i
		break
for i in range(n - 1, -1, -1):
	if l[i] != k[i]:
		e = i
		break
f = l[s:e + 1]
ml = l[0:s:1] + f[::-1] + l[e + 1::1]
if ml != k:
	print('no')
else:
	print('yes')
	if s != e:
		print(s + 1, e + 1)
	else:
		print('1 1')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
arr = list(map(int, input().split()))
b = sorted(arr)
ans = [0] * n
for i in range(n):
	if arr[i] != b[i]:
		ans[i] = 1
if 1 not in ans:
	print('yes')
	print('1 1')
	quit()
l = ans.index(1)
r = n - ans[::-1].index(1)
arr[l:r] = arr[l:r][::-1]
if arr == b:
	print('yes')
	print(l + 1, r)
else:
	print('no')


def reArrange(lst):
	newLst = []
	for i in range(-1, -len(lst) - 1, -1):
		newLst.append(lst[i])
	return newLst
n = int(input())
a = list(map(int, input().split()))
l = 0
r = 0
new = sorted(a)
if a == new:
	print('yes')
	print(1, 1)
else:
	for i in range(n):
		if a[i] != new[i]:
			l = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] != new[i]:
			r = i
			break
	subLst = a[l:r + 1]
	a[l:r + 1] = reArrange(subLst)
	if a == new:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


def sort_the_array(n, a):
	s = sorted(a)
	left = 0
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			left = i
			break
	right = left
	while right < n - 1 and a[right] > a[right + 1]:
		right += 1
	a[left:right + 1] = reversed(a[left:right + 1])
	if a == s:
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')
n = int(input())
a = list(map(int, input().split()))
sort_the_array(n, a)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
l = -1
r = -1
for i in range(n):
	if a[i] != b[i] and l == -1:
		l = i
	if a[i] != b[i]:
		r = i
if l == r == -1:
	l = r = 0
u = l
v = r
while u < v:
	(a[u], a[v]) = (a[v], a[u])
	u += 1
	v -= 1
for i in range(n):
	if a[i] != b[i]:
		print('no')
		exit()
print('yes')
print(str(l + 1), str(r + 1))


from sys import stdin
n = int(stdin.readline().rstrip())
a = [int(i) for i in stdin.readline().rstrip().split()]
start_point = -1
end_point = -1
reversed = False
segments_found = 0
for i in range(n):
	if reversed:
		if i == n - 1 or a[i] < a[i + 1]:
			reversed = False
			end_point = i
			segments_found += 1
	elif i < n - 1 and a[i] > a[i + 1]:
		reversed = True
		start_point = i
output = ''
if segments_found > 1:
	print('no')
elif start_point == end_point and end_point == -1:
	start_point = 0
	end_point = 0
	print('yes')
	print(str(start_point + 1) + ' ' + str(end_point + 1))
elif (end_point == n - 1 or a[start_point] <= a[end_point + 1]) and (start_point == 0 or a[end_point] >= a[start_point - 1]):
	print('yes')
	print(str(start_point + 1) + ' ' + str(end_point + 1))
else:
	print('no')


n = int(input())
arr = list(map(int, input().split(' ')))
a = -1
b = n
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		if a == -1:
			a = i
	if a != -1:
		if arr[i] < arr[i + 1]:
			b = i + 1
			break
if a == -1:
	print('yes')
	print('1 1')
	exit(0)
arr[a:b] = arr[a:b][::-1]
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		print('no')
		exit(0)
print('yes')
print(a + 1, b)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
(x, y) = (-1, -1)
for i in range(n):
	if a[i] != b[i]:
		if x == -1:
			x = i
		y = i
j = y
i = x
c = 0
while i <= y and j > x - 1:
	if a[i] != b[j]:
		c = -1
	i += 1
	j -= 1
if x == -1 and y == -1:
	x = 0
	y = 0
if c == 0:
	print('yes')
	print(x + 1, y + 1)
else:
	print('no')


n = int(input())
ls = list(map(int, input().split()))
l = 0
r = 0
start = False
sub_ls = []
for i in range(n - 1):
	if ls[i + 1] < ls[i]:
		if start == False:
			start = True
			l = i
		sub_ls.append(ls[i])
		if i == n - 2:
			sub_ls.append(ls[i + 1])
			r = i + 1
	elif start == True and ls[i + 1] > ls[i]:
		sub_ls.append(ls[i])
		r = i
		break
sub_ls.reverse()
if len(sub_ls) == 0:
	new_ls = ls
else:
	new_ls = ls[0:l] + sub_ls + ls[r + 1:]
flag = True
for j in range(n - 1):
	if new_ls[j + 1] < new_ls[j]:
		flag = False
		break
if flag:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


num_elements = int(input())
arrs = list(map(int, input().split()))
sorted_arrs = sorted(arrs)
left = 0
right = 0
for index in range(num_elements):
	if arrs[index] != sorted_arrs[index]:
		left = index
		break
for index in range(num_elements - 1, -1, -1):
	if arrs[index] != sorted_arrs[index]:
		right = index
		break
(start, end) = (left, right)
while start < end:
	(arrs[end], arrs[start]) = (arrs[start], arrs[end])
	start += 1
	end -= 1
if arrs != sorted_arrs:
	print('no')
else:
	print('yes')
	print(left + 1, right + 1)


n = int(input())
a = list(map(int, input().split()))

def f():
	i = 1
	while i < n and a[i - 1] <= a[i]:
		i += 1
	if i == n:
		return (0, 0)
	dec_start = i
	largest_so_far = a[dec_start - 2] if dec_start - 2 >= 0 else float('-inf')
	while i < n and a[i - 1] >= a[i] and (a[i] >= largest_so_far):
		i += 1
	if i == n:
		return (dec_start - 1, n - 1)
	if a[i] < largest_so_far:
		return
	inc_start = i
	largest_so_far = max(largest_so_far, a[dec_start - 1])
	while i < n and a[i - 1] <= a[i] and (a[i] >= largest_so_far):
		i += 1
	if i == n:
		return (dec_start - 1, inc_start - 1)
	return
r = f()
if r == None:
	print('no')
else:
	print('yes')
	print(r[0] + 1, r[1] + 1)


n = int(input())
arr = list(map(int, input().split()))
(l, r) = (0, n - 1)
for i in range(n - 1):
	if arr[i + 1] < arr[i]:
		l = i
		break
for i in range(l, n - 1):
	if arr[i + 1] > arr[i]:
		r = i
		break
if sorted(arr) == arr[:l] + arr[l:r + 1][::-1] + arr[r + 1:]:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


def main():
	N = int(input())
	array = list(map(int, input().split()))
	desLeft = -1
	desRight = 0
	for i in range(1, N):
		if array[i] < array[desRight]:
			desRight = i
			if desLeft == -1:
				desLeft = i - 1
		if desLeft == -1:
			if array[i] >= array[desRight]:
				desRight = i
	if desRight == 0 or desLeft == -1:
		print('yes')
		print(1, 1)
		return True
	changedArray = []
	changedSegment = []
	for i in range(desLeft, desRight + 1):
		changedSegment.append(array[i])
	for i in range(1, len(changedSegment) - 1):
		if changedSegment[i] > changedSegment[i - 1]:
			print('no')
			return True
	changedSegment.sort()
	for a in array:
		changedArray.append(a)
	for i in range(desLeft, desRight + 1):
		changedArray[i] = changedSegment[i - desLeft]
	array.sort()
	if changedArray == array:
		print('yes')
		print(desLeft + 1, desRight + 1)
	else:
		print('no')
	return True
main()


n = int(input())
a = list(map(int, input().split()))
c = [0, 1]
f = 0
o = 'yes'
for i in range(n - 1):
	if a[i] > a[i + 1]:
		if f == 0:
			c[0] = i
		c[1] = i + 2
		f += 1
	elif f > 0 and a[i] < a[i + 1]:
		break
w = a[0:c[0]] + a[c[0]:c[1]][::-1] + a[c[1]:n]
for i in range(n - 1):
	if w[i] > w[i + 1]:
		o = 'no'
if o == 'yes':
	print(o)
	print(str(c[0] + 1) + ' ' + str(c[1]))
else:
	print(o)


n = input()
arr = list(map(int, input().split()))
ka = []
kr = sorted(arr)
if kr == arr:
	print('yes')
	print(1, 1)
else:
	for i in range(len(arr) - 1):
		if arr[i] - arr[i + 1] < 0:
			ka.append(-1)
		else:
			ka.append(1)
	k = ka.count(1)
	cnt = 0
	stindex = ka.index(1)
	lastindex = len(ka) - 1 - ka[::-1].index(1)
	if stindex + k - 1 != lastindex:
		print('no')
	else:
		arr[stindex:lastindex + 2] = arr[stindex:lastindex + 2][::-1]
		ks = sorted(arr)
		if ks == arr:
			print('yes')
			print(stindex + 1, lastindex + 2)
		else:
			print('no')


def check_1(one):
	ans = True
	for i in range(len(one) - 1):
		if one[i] > one[i + 1]:
			ans = False
			break
	return ans

def check_2(one):
	ans = True
	for i in range(len(one) - 1):
		if one[i] < one[i + 1]:
			ans = False
			break
	return ans
n = input()
one = [int(i) for i in input().split(' ')]
if check_1(one):
	print('yes')
	print('1 1')
elif check_2(one):
	print('yes')
	print(f'1 {int(n)}')
else:
	(first_ind, last_ind) = (0, int(n) - 1)
	for i in range(len(one) - 1):
		if one[i] > one[i + 1]:
			first_ind = i
			break
	f = one[:first_ind]
	for i in range(first_ind, len(one) - 1):
		if one[i] < one[i + 1]:
			last_ind = i
			break
	l = one[first_ind:last_ind + 1]
	l = l[::-1]
	_f = one[last_ind + 1:]
	ans = f + l + _f
	if check_1(ans):
		print('yes')
		print(f'{first_ind + 1} {last_ind + 1}')
	else:
		print('no')


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	b = a.copy()
	b.sort()
	(l, r) = (-1, -1)
	for i in range(n):
		if a[i] != b[i]:
			l = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] != b[i]:
			r = i
			break
	if l == -1:
		print('yes\n1 1')
		return
	a[l:r + 1] = list(reversed(a[l:r + 1]))
	for i in range(n):
		if a[i] != b[i]:
			print('no')
			return
	print('yes\n{} {}'.format(l + 1, r + 1))
solve()


n = int(input())
a = list(input().split())
i = 0
while i < n:
	a[i] = int(a[i])
	i = i + 1
(b, i) = (True, 1)
while i < n:
	if a[i - 1] >= a[i]:
		b = False
		break
	i = i + 1
if b:
	print('yes')
	print('1 1')
else:
	i = 1
	while a[i - 1] < a[i]:
		i = i + 1
	p = i - 2
	while i < n and a[i - 1] > a[i]:
		i = i + 1
	q = i
	while i < n and a[i - 1] < a[i]:
		i = i + 1
	if i != n:
		print('no')
	elif p == -1 and q == n:
		print('yes')
		print(1, n)
	elif p == -1:
		if a[0] < a[q]:
			print('yes')
			print(1, q)
		else:
			print('no')
	elif q == n:
		if a[p] < a[n - 1]:
			print('yes')
			print(p + 2, n)
		else:
			print('no')
	elif a[p + 1] < a[q] and a[p] < a[q - 1]:
		print('yes')
		print(p + 2, q)
	else:
		print('no')


n = int(input())
A = list(map(int, input().split()))
B = sorted(A)
if A == B:
	print('yes\n{} {}'.format(1, 1))
	exit()
l = -1
r = -1
for i in range(n):
	if A[i] != B[i]:
		if l == -1:
			l = i
		else:
			r = i
A[l:r + 1] = A[l:r + 1][::-1]
if A == B:
	print('yes\n{} {}'.format(l + 1, r + 1))
else:
	print('no')


n = int(input())
lst = list(map(int, input().split()))[:n]
temp = lst.copy()
temp.sort()
lst_res = []
for i in range(n):
	if lst[i] != temp[i]:
		lst_res.append(i)
if lst_res != []:
	temp_lst = temp[lst_res[0]:lst_res[-1] + 1]
	temp_lst.sort(reverse=True)
else:
	pass
if temp == lst:
	print('yes')
	print('1 1')
elif temp_lst == lst[lst_res[0]:lst_res[-1] + 1]:
	print('yes')
	print(lst_res[0] + 1, lst_res[-1] + 1)
else:
	print('no')


datain = True
if datain:
	n = int(input())
	a = list(map(int, input().split()))
else:
	n = 2
	a = [1, 2]
sa = len(a)
le = 0
ri = 0
cnt = 0
x0 = 0
y0 = 0
notok = False
if sa == 1:
	print('yes')
	print('1 1')
else:
	if a[0] > a[1]:
		le = 0
		ri = 0
		while ri + 1 < sa and a[ri] > a[ri + 1]:
			ri += 1
		a[le:ri + 1] = sorted(a[le:ri + 1])
		for i in range(sa - 1):
			if a[i] > a[i + 1]:
				notok = True
				break
		if notok:
			print('no')
		else:
			cnt += 1
			(x0, y0) = (le, ri)
	else:
		le = 0
		while le + 1 < sa and a[le] < a[le + 1]:
			le += 1
		if le == sa - 1:
			cnt += 2
			(x0, y0) = (1, 1)
		else:
			ri = le
			while ri + 1 < sa and a[ri] > a[ri + 1]:
				ri += 1
			a[le:ri + 1] = sorted(a[le:ri + 1])
			for i in range(sa - 1):
				if a[i] > a[i + 1]:
					notok = True
					break
			if notok:
				print('no')
			else:
				cnt += 1
				(x0, y0) = (le, ri)
	if notok:
		pass
	elif cnt > 1:
		print('yes')
		print('1 1')
	else:
		print('yes')
		print(x0 + 1, y0 + 1)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
T = 1
for _ in range(T):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	b = a.copy()
	b.sort()
	k = 0
	ls = 0
	rs = 0
	for i in range(n):
		if b[i] != a[i]:
			ls = i
			break
	for i in range(n):
		if b[n - 1 - i] != a[n - 1 - i]:
			rs = n - 1 - i
			break
	l = list(range(ls, rs + 1))
	if len(l) < 2:
		print('yes')
		print(1, 1)
		continue
	for i in range(len(l) - 1):
		if a[l[i + 1]] < a[l[i]]:
			k = 1
		else:
			k = 0
			break
	if k == 1:
		print('yes')
		print(l[0] + 1, l[-1] + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
l = r = 0
for i in range(n):
	if a[i] != sorted_a[i]:
		l = i
		break
for i in range(len(a) - 1, -1, -1):
	if a[i] != sorted_a[i]:
		r = i
		break
(i, j) = (l, r)
while i < j:
	(a[i], a[j]) = (a[j], a[i])
	i += 1
	j -= 1
if a != sorted_a:
	print('no')
	exit()
print('yes')
print('{} {}'.format(l + 1, r + 1))


import collections, math, itertools, bisect, heapq, copy

class Solution:

	def solve(self):

		def reverse(A, start, end):
			while start <= end:
				(A[start], A[end]) = (A[end], A[start])
				start += 1
				end -= 1
		n = int(input())
		A = list(map(int, input().rstrip().split()))
		res = []
		for i in range(n - 1):
			if A[i] > A[i + 1]:
				for j in range(n - 1, 0, -1):
					if A[j] < A[j - 1]:
						reverse(A, i, j)
						res = [i, j]
						break
				break
		temp = sorted(A)
		for i in range(n):
			if temp[i] != A[i]:
				print('no')
				return
		print('yes')
		if not res:
			print(1, 1)
		else:
			print(res[0] + 1, res[1] + 1)
solution = Solution()
solution.solve()


n = int(input())
c = list(map(int, input().split()))
if n == 1:
	print('yes')
	print(1, 1)
else:
	l = 0
	for i in range(1, n):
		if c[i - 1] < c[i]:
			if l == 1:
				y = i - 1
				l = 2
		elif c[i - 1] > c[i]:
			if l == 0:
				x = i - 1
				l = 1
			elif l == 2:
				l = 3
	if l == 0:
		print('yes')
		print(1, 1)
	elif l == 1:
		if x == 0 or c[x - 1] <= c[-1]:
			print('yes')
			print(x + 1, n)
		else:
			print('no')
	elif l == 2:
		if x == 0 and c[x] < c[y + 1] or (c[x - 1] < c[y] and c[x] < c[y + 1]):
			print('yes')
			print(x + 1, y + 1)
		else:
			print('no')
	else:
		print('no')


def test(n, a):
	b = sorted(a)
	c = a
	count = 0
	flag = False
	start = 0
	end = 0
	result = []
	if a == b:
		result.append('yes')
		result.append('1 1')
	else:
		for i in range(len(a)):
			if a[i] != b[i] and flag is False:
				flag = True
				start = i
				continue
			if flag is True and a[i] != b[i]:
				end = i
		s = start
		e = end
		while s < e:
			(c[s], c[e]) = (c[e], c[s])
			s += 1
			e -= 1
		if c == b:
			result.append('yes')
			result.append('{} {}'.format(start + 1, end + 1))
		else:
			result.append('no')
	return result
n = int(input())
a = [int(i) for i in input().split()]
result = test(n, a)
for item in result:
	print(item)


n = int(input())
integers = [int(t) for t in input().split()]
start = -1
end = -1
largerthan = 0
result = 'yes'
for (i, integer) in enumerate(integers):
	if i == 0:
		continue
	if start == -1:
		if integers[i - 1] < integer:
			continue
		else:
			if i - 2 >= 0:
				largerthan = integers[i - 2]
			start = i - 1
	elif end == -1:
		if integers[i - 1] > integer:
			continue
		else:
			if integer < integers[start]:
				result = 'no'
				break
			if integers[i - 1] < largerthan:
				result = 'no'
				break
			end = i - 1
	elif integers[i - 1] > integer:
		result = 'no'
		break
if start == -1:
	start = end = 0
elif end == -1:
	if integers[-1] < largerthan:
		result = 'no'
	else:
		end = n - 1
print(result)
if result == 'yes':
	print(start + 1, end + 1)


g = int(input())
N = g
r = input()
listing = []
for x in r.split():
	listing.append(int(x))
wseg = 0
l2 = 0
li = []
joker = 0
for i in range(N - 1):
	if listing[i] > listing[i + 1]:
		l2 += 1
		n2 = i
		if l2 != 1:
			if n2 - t2 > 1:
				wseg = wseg + 1
				print('no')
				joker = 1
				break
		li.append(n2)
		t2 = i
if len(li) == 0:
	print('yes')
	print('1', '1')
elif joker == 0:
	if li[0] != 0 and li[len(li) - 1] != N - 2:
		if listing[li[len(li) - 1] + 1] < listing[li[0] - 1] or listing[li[0]] > listing[li[len(li) - 1] + 2]:
			print('no')
		else:
			print('yes')
			print(li[0] + 1, li[len(li) - 1] + 2)
	elif li[0] == 0 and li[len(li) - 1] != N - 2:
		if listing[li[0]] > listing[li[len(li) - 1] + 2]:
			print('no')
		else:
			print('yes')
			print(li[0] + 1, li[len(li) - 1] + 2)
	elif li[0] != 0 and li[len(li) - 1] == N - 2:
		if listing[li[len(li) - 1] + 1] < listing[li[0] - 1]:
			print('no')
		else:
			print('yes')
			print(li[0] + 1, li[len(li) - 1] + 2)
	else:
		print('yes')
		print(li[0] + 1, li[len(li) - 1] + 2)


n = int(input())
arr = list(map(int, input().split()))
t = 0
d = []
for i in range(1, n):
	if arr[i - 1] > arr[i]:
		if t != 1:
			d.append(i)
		t = 1
	if arr[i - 1] < arr[i]:
		if t == 1:
			if arr[i] >= arr[d[0] - 1]:
				d.append(i)
			t = 2
	if i == n - 1 and len(d) == 1:
		d.append(n)
	if t == 2:
		break
if len(d) == 1:
	print('no')
elif d == []:
	print('yes')
	print(1, 1)
else:
	s = arr[:d[0] - 1] + arr[d[0] - 1:d[1]][::-1] + arr[d[1]:]
	if s == sorted(arr):
		print('yes')
		print(d[0], d[1])
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
(l, r) = (-1, -1)
is_sorted = True
for i in range(len(arr) - 1):
	if arr[i + 1] < arr[i]:
		if l == -1:
			l = i
			is_sorted = False
	elif l != -1 and r == -1:
		r = i
if not is_sorted:
	if r == -1:
		r = len(arr) - 1
	arr[l:r + 1] = reversed(arr[l:r + 1])
	is_sorted = True
	for i in range(len(arr) - 1):
		if arr[i + 1] < arr[i]:
			is_sorted = False
			break
	if not is_sorted:
		print('no')
	else:
		print('yes')
		print(l + 1, r + 1)
else:
	print('yes')
	print('1 1')


n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b.sort()
l = r = -1
dic = {}
for i in range(n):
	dic.setdefault(b[i], i)
for i in range(n):
	a[i] = dic[a[i]]
for i in range(n):
	if a[i] != i:
		l = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != i:
		r = i
		break
if l == -1 or r == -1:
	print('yes')
	print(1, 1)
else:
	a[l:r + 1] = reversed(a[l:r + 1])
	f = 0
	for i in range(n):
		if a[i] != i:
			f = 1
			break
	if f:
		print('no')
	else:
		print('yes')
		print(l + 1, r + 1)


import copy
n = int(input())
a = list(map(int, input().split()))
b = copy.deepcopy(a)
b.sort()
if a == b:
	print('yes')
	print(1, 1)
else:
	x = 0
	y = 0
	for i in range(1, n):
		if a[i - 1] > a[i]:
			x = i
			break
	for j in range(x, n):
		if a[j - 1] < a[j]:
			y = j
			break
	if y == 0:
		y = n
	new = a[x - 1:y]
	new.sort()
	a[x - 1:y] = new
	if a == b:
		print('yes')
		print(x, y)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
count = 0
ans = []
c = sorted(l)
for i in range(n):
	if l[i] != c[i]:
		count += 1
		ans.append(i)
if count == 0:
	print('yes')
	print(1, 1)
else:
	k = l[ans[0]:ans[len(ans) - 1] + 1]
	k.reverse()
	if l[:ans[0]] + k + l[ans[len(ans) - 1] + 1:] == c:
		print('yes')
		print(ans[0] + 1, ans[len(ans) - 1] + 1)
	else:
		print('no')


A = int(input())
B = input().split()
Aarray = [int(x) for x in list(B)]
Barray = sorted(Aarray)
(i, j) = (0, A)
if A > 2:
	while Aarray[i] == Barray[i]:
		if i != A - 1:
			i += 1
		else:
			break
	while Aarray[j - 1] == Barray[j - 1]:
		if j != 0:
			j -= 1
		else:
			break
elif A == 2:
	i = 0
	j = 2
elif A == 1:
	print('yes')
	print(str(1) + ' ' + str(1))
	exit()
if (i == A - 1) & (j == 0):
	print('yes')
	print(str(1) + ' ' + str(1))
else:
	done = False
	tam = i
	tam1 = j
	if Aarray[i] > Aarray[j - 1]:
		while i != j - 1:
			if Aarray[i] > Aarray[i + 1]:
				i += 1
				done = True
			else:
				done = False
				break
		if done:
			print('yes')
			print(str(tam + 1) + ' ' + str(tam1))
		else:
			print('no')
	else:
		while i != j - 1:
			if Aarray[i] < Aarray[i + 1]:
				i += 1
				done = True
			else:
				done = False
				break
		if done:
			print('yes')
			print(str(tam + 1) + ' ' + str(tam1 - 1))
		else:
			print('no')


import copy
n = int(input())
arr = list(map(int, input().split()))
arrSorted = sorted(arr)
left = 0
right = 0
for i in range(n):
	if arr[i] != arrSorted[i]:
		left = i
		break
for i in range(n - 1, -1, -1):
	if arr[i] != arrSorted[i]:
		right = i
		break
if arr == arrSorted:
	print('yes')
	print('1 1')
else:
	fakeArr = copy.deepcopy(arr)
	j = 0
	for i in range(left, right + 1):
		fakeArr[i] = arr[right - j]
		j += 1
	if fakeArr == arrSorted:
		print('yes')
		print(str(left + 1), str(right + 1))
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
arr2 = []
for i in arr:
	arr2.append(i)
arr2.sort()
f2 = 0
for i in range(0, n):
	if arr[i] != arr2[i]:
		f2 = 1
		break
if f2 == 0:
	print('yes')
	print(1, end=' ')
	print(1)
else:
	l = -1
	r = -1
	count = 0
	f = 0
	for i in range(0, n):
		if arr[i] != arr2[i] and count == 0:
			l = i
			count += 1
		if arr[i] != arr2[i] and count == 1:
			r = i
		if arr[i] != arr2[i] and count == 2:
			f = 1
			break
	for i in range(l, r):
		if arr[i + 1] > arr[i]:
			f = 1
			break
	if f == 1:
		print('no')
	else:
		print('yes')
		print(l + 1, end=' ')
		print(r + 1)


n = int(input())
l = [int(x) for x in input().split()]
(start, end) = (0, 0)
for i in range(n - 1):
	if l[i] > l[i + 1]:
		start = i
		while i < n - 1:
			if l[i] > l[i + 1]:
				i += 1
			else:
				break
		end = i
		break
temp = l[:start] + list(reversed(l[start:end + 1])) + l[end + 1:]
for i in range(n - 1):
	if temp[i] > temp[i + 1]:
		print('no')
		break
else:
	print('yes')
	print(start + 1, end + 1)


def reverse(arr):
	start = 0
	end = 0
	flag = 0
	p = 0
	for i in range(0, len(arr) - 1):
		if flag == 0:
			if arr[i] > arr[i + 1]:
				start = i
				p = 1
				flag = 1
		if flag == 1:
			if arr[i] < arr[i + 1]:
				end = i
				flag = 2
		if flag == 2:
			if arr[i] > arr[i + 1]:
				flag = 3
				break
	if flag == 3:
		print('no')
	else:
		if start == 0 and end != 0:
			if arr[start] < arr[end + 1]:
				print('yes')
				print(start + 1, end + 1)
			else:
				print('no')
		if start != 0 and end == 0:
			if arr[len(arr) - 1] > arr[start - 1]:
				print('yes')
				print(start + 1, len(arr))
			else:
				print('no')
		if start == 0 and end == 0:
			if p == 1:
				print('yes')
				print(start + 1, len(arr))
			else:
				print('yes')
				print(start + 1, end + 1)
		if start != 0 and end != 0:
			if arr[start] < arr[end + 1] and arr[end] > arr[start - 1]:
				print('yes')
				print(start + 1, end + 1)
			else:
				print('no')
n = int(input())
arr = list(map(int, input().strip().split()))
reverse(arr)


def solve():
	n = ii()
	l = li()
	if sorted(l) == l:
		print('yes')
		print(1, 1)
		return
	f = False
	end = n - 1
	start = 0
	for i in range(1, n):
		if l[i] < l[i - 1] and (not f):
			start = i - 1
			f = True
		if f and l[i] > l[i - 1]:
			end = i - 1
			break
	t = l[:start] + l[start:end + 1][::-1] + l[end + 1:]
	if f and t == sorted(l):
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
si = lambda : input()
solve()


n = int(input())
numbers = list()
numbers = list(map(int, input().strip().split()))
sorted_numbers = sorted(numbers)
check = True
start = 1
end = 1
for i in range(0, n):
	if numbers[i] != sorted_numbers[i]:
		if check:
			start = i + 1
			check = False
		end = i + 1
numbers[start - 1:end] = numbers[start - 1:end][::-1]
if numbers == sorted_numbers:
	print('yes')
	print(start, end)
else:
	print('no')


read = lambda : map(int, input().split())
n = int(input())
a = list(read())
i = 0
while i < n - 1 and a[i] < a[i + 1]:
	i += 1
j = n - 1
while j > 0 and a[j] > a[j - 1]:
	j -= 1
flag = True
for k in range(i, j):
	if a[k] < a[k + 1]:
		flag = False
		break
if i > 0 and a[j] < a[i - 1]:
	flag = False
elif j < n - 1 and a[i] > a[j + 1]:
	flag = False
(i, j) = (i + 1, j + 1)
if i > j:
	i = j = 1
	flag = True
if flag:
	print('yes')
	print(i, j)
else:
	print('no')


n = int(input())
li = list(map(int, input().split(' ', n)[:n]))
flf = -1
flg = 0
(st, en) = (1, 1)
for i in range(n - 1):
	if li[i] > li[i + 1] and flf == -1:
		flf = 1
		st = i + 1
	elif li[i] > li[i + 1] and flf == 0:
		flg = 12
	elif li[i] < li[i + 1] and flf == 1:
		flf = 0
		en = i + 1
if flf == 1 and li[n - 2] > li[n - 1]:
	en = n
	flf = 0
if (flf == 0 or flf == -1) and flg == 0 and (en == n or (en != n and li[st - 1] < li[en])) and (st == 1 or (st != 1 and li[en - 1] > li[st - 2])):
	print('yes')
	print(st, en)
else:
	print('no')


def solution(n, l):
	sl = sorted(l)
	i = -1
	j = n
	alreadySorted = True
	for k in range(n):
		if sl[k] != l[k]:
			alreadySorted = False
			break
	if alreadySorted:
		return [0, 0]
	for k in range(n):
		if l[k] != sl[k]:
			if i == -1:
				i = k
			else:
				j = k
	if i >= 0 and j == n:
		j = n - 1
	if i == -1:
		return []
	for k in range(i, j + 1):
		if l[k] != sl[j + i - k]:
			return []
	return [i, j]
n = int(input())
l = [int(x) for x in input().split(' ')]
ans = solution(n, l)
if len(ans) == 2:
	print('yes')
	print(str(ans[0] + 1) + ' ' + str(ans[1] + 1))
else:
	print('no')


n = int(input().strip())
arr = list(map(int, input().strip().split()))
if n == 1:
	print('yes')
	print(1, 1)
else:
	x = 0
	y = 0
	found = False
	for i in range(len(arr) - 1):
		if arr[i] > arr[i + 1]:
			x = i
			for j in range(i + 1, len(arr) - 1):
				if arr[j] < arr[j + 1]:
					y = j
					for k in range(j + 1, len(arr) - 1):
						if arr[k] > arr[k + 1]:
							print('no')
							found = True
							break
					break
			break
	if not found:
		if x == 0:
			if y == 0:
				print('yes')
				if arr[0] < arr[1]:
					print(1, 1)
				else:
					print(1, n)
			elif arr[x] < arr[y + 1]:
				print('yes')
				print(x + 1, y + 1)
			else:
				print('no')
		elif y == 0:
			if arr[-1] > arr[x - 1]:
				print('yes')
				print(x + 1, n)
			else:
				print('no')
		elif arr[y] > arr[x - 1] and arr[x] < arr[y + 1]:
			print('yes')
			print(x + 1, y + 1)
		else:
			print('no')


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(n,) = I()
a = I() + [INF]
m = min(a)
if a == sorted(a):
	print('yes')
	print(1, 1)
	exit()
d = 0
start = -1
end = -1
for i in range(n):
	if a[i] > a[i + 1] and (not d):
		d = 1
		start = i
		end = i + 1
	elif a[i] > a[i + 1] and d:
		end = i + 1
	elif d:
		a = a[:start] + a[start:end + 1][::-1] + a[end + 1:]
		if sorted(a) == a:
			print('yes')
			print(start + 1, end + 1)
			exit()
		else:
			break
ans = 'no'
print(ans)


n = int(input())
a = [int(i) for i in input().split()]
b = a.copy()
b.sort()
l = 0
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
i = l + 1
r = l
possible = True
while i < n:
	if a[i] != b[i]:
		r = i
	i += 1
for i in range(l, r + 1):
	if a[i] != b[r - i + l]:
		possible = False
		break
if possible:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


from sys import stdin
n = int(stdin.readline())
list1 = list(map(int, stdin.readline().strip().split()))
list2 = []
c = 0
for i in range(1, n):
	if list1[i] < list1[i - 1]:
		if c == 0:
			list2.append(i - 1)
			list2.append(i)
			c = 1
		else:
			list2.append(i)
	else:
		c = 0
		continue
if list2:
	f = 0
	for i in range(1, len(list2)):
		if list2[i] - list2[i - 1] != 1:
			f = 1
			break
	if f == 1:
		print('no')
	else:
		ff = 0
		list1[list2[0]:list2[-1] + 1] = reversed(list1[list2[0]:list2[-1] + 1])
		list1 = list1[0:list2[0]] + list1[list2[0]:list2[-1]] + list1[list2[-1]:]
		for i in range(n - 1):
			if list1[i] > list1[i + 1]:
				ff = 1
				break
		if ff == 0:
			print('yes')
			print(list2[0] + 1, list2[-1] + 1)
		else:
			print('no')
else:
	print('yes')
	print(1, 1)


n = int(input())
arr = list(map(int, input().split()))
checking = 1
changes = 0
counter = 1
for i in range(1, n):
	if changes > 2:
		counter = 0
		break
	if checking == 1 and arr[i - 1] > arr[i]:
		checking = 0
		change1 = i
		changes += 1
	elif checking == 0 and arr[i] > arr[i - 1]:
		change2 = i
		checking = 1
		changes += 1
if counter == 0 or changes > 2:
	print('no')
elif changes == 0:
	print('yes\n1 1')
elif changes == 1:
	if change1 == 1:
		print(f'yes\n1 {n}')
	elif arr[-1] >= arr[change1 - 2]:
		print(f'yes\n{change1} {n}')
	else:
		print('no')
elif change1 == 1:
	if arr[0] <= arr[change2]:
		print(f'yes\n1 {change2}')
	else:
		print('no')
elif arr[change1 - 1] <= arr[change2] and arr[change2 - 1] >= arr[change1 - 2]:
	print(f'yes\n{change1} {change2}')
else:
	print('no')


n = int(input())
f = [int(x) for x in input().split()]
flag = True
fail = False
reverse = False
k = f[0]
i = 1
while i < n:
	if f[i] > k:
		k = f[i]
		i += 1
		continue
	if f[i] < k and flag:
		reverse = True
		start = i - 1
		t = k
		while i < n and f[i] < t:
			t = f[i]
			i += 1
		flag = False
		end = i - 1
		if start > 0:
			if f[end] < f[start - 1]:
				fail = True
				break
	else:
		fail = True
		break
if not fail:
	print('yes')
	if reverse:
		print(str(start + 1) + ' ' + str(end + 1))
	else:
		print('1 1')
else:
	print('no')


def is_sorted(a, left, right):
	s1 = a[:left - 1]
	s2 = a[left - 1:right][::-1]
	s3 = a[right:]
	s = s1 + s2 + s3
	for i in range(1, len(s)):
		if s[i] < s[i - 1]:
			return False
	return True
n = int(input())
a = [-1 * int(1000000000.0) - 5] + list(map(int, input().split(' '))) + [int(1000000000.0) + 5]
left = -1
right = -1
length = 0
borked = False
for i in range(1, n + 2):
	if a[i] < a[i - 1]:
		if left == -1:
			left = i - 1
		right = i
if left == -1 and right == -1:
	print('yes')
	print('1 1')
elif not is_sorted(a, left + 1, right + 1):
	print('no')
else:
	print('yes')
	print(left, right)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
r = n - 1
l = 0
if a == b:
	print('yes')
	print('1 1')
else:
	while a[l] == b[l]:
		l += 1
	while a[r] == b[r]:
		r -= 1
	if a[l:r + 1] == b[l:r + 1][::-1]:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


def can_invert(n, nums):
	inv = False
	start = -1
	curr = False
	range = ''
	i = 1
	while i < n:
		if nums[i] < nums[i - 1]:
			if inv:
				return ''
			elif start == -1:
				start = i
				curr = True
				i += 1
			elif i == n - 1:
				if start == 1:
					range += str(start) + ' ' + str(i + 1)
				elif nums[i] > nums[start - 2]:
					range += str(start) + ' ' + str(i + 1)
				else:
					range = ''
				return range
			else:
				i += 1
		elif curr:
			if nums[i] < nums[start - 1]:
				return ''
			elif start == 1:
				range = str(start) + ' ' + str(i)
				curr = False
				inv = True
				i += 1
			elif nums[i - 1] > nums[start - 2]:
				range = str(start) + ' ' + str(i)
				curr = False
				inv = True
				i += 1
			else:
				return ''
		else:
			i += 1
	if inv:
		return range
	elif curr:
		return '1 2'
	else:
		return '1 1'

def main():
	n = int(input())
	nums = [int(i) for i in input().split()]
	ans = can_invert(n, nums)
	if ans == '':
		print('no')
	else:
		print('yes\n' + ans)
main()


from sys import stdin

def solve():
	n = int(input())
	if n == 1:
		return ['yes', '1 1']
	A = [int(i) for i in stdin.readline().split()]
	if list(reversed(A)) == sorted(A):
		return ['yes', str(1) + ' ' + str(len(A))]
	seg = False
	(l, r) = (0, 0)
	for i in range(1, len(A)):
		if seg and A[i - 1] > A[i]:
			if i == len(A) - 1:
				r = i
			continue
		elif seg:
			r = i - 1
			break
		elif A[i - 1] > A[i]:
			seg = True
			l = i - 1
	s = str(l + 1) + ' ' + str(r + 1)
	if l == 0 and r == len(A) - 1:
		return ['yes', s]
	elif l == 0:
		if A[l] > A[r + 1]:
			return ['no']
	elif r == len(A) - 1:
		if A[r] < A[l - 1]:
			return ['no']
		return ('yes', s)
	elif A[r] < A[l - 1] or A[l] > A[r + 1]:
		return ['no']
	for i in range(r + 1, len(A)):
		if i == r + 1:
			continue
		elif A[i] < A[i - 1]:
			return ['no']
	return ('yes', s)
ans = solve()
if len(ans) == 2:
	print(ans[0])
	print(ans[1])
else:
	print(ans[0])


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
	b.append(a[i])
b.sort()
f = -1
l = 0
for i in range(n):
	if a[i] != b[i]:
		if f == -1:
			f = i
		l = i
if f != -1:
	c = a[:f]
	if f != 0:
		c += a[l:f - 1:-1]
	else:
		c += a[l::-1]
	c += a[l + 1:]
else:
	f = 0
	c = a
flag = True
for i in range(n):
	if b[i] != c[i]:
		flag = False
if flag:
	print('yes')
	print(f + 1, l + 1)
else:
	print('no')


n = int(input())
arr = [int(i) for i in input().split()]
a = arr[:]
a.sort()
l = 1
r = 1
b = True
for i in range(n):
	if a[i] != arr[i]:
		r = i + 1
		if b:
			l = i + 1
			b = False
carr = arr[:]
for i in range(l, r + 1):
	carr[i - 1] = arr[l + r - i - 1]
f = True
for i in range(n):
	if a[i] != carr[i]:
		f = False
		break
if f:
	print('yes')
	print(l, r)
else:
	print('no')


def ii():
	return int(input())

def ss():
	return [x for x in input()]

def si():
	return [int(x) for x in input().split()]

def mi():
	return map(int, input().split())
a = ii()
s = [0] + si() + [10 ** 9 + 1]
key = True
(pos1, pos2) = (0, 0)
for i in range(1, a + 2):
	if key:
		if s[i - 1] > s[i]:
			key = False
			pos1 = i - 1
	if not key:
		if s[i - 1] < s[i]:
			pos2 = i - 1
			break
s = s[:pos1] + s[pos2:pos1 - 1:-1] + s[pos2 + 1:]
if pos1 == 0 and pos2 == 0:
	print('yes')
	print(1, 1)
else:
	key = True
	for i in range(1, a + 2):
		if s[i] < s[i - 1]:
			print('no')
			key = False
			break
	if key:
		print('yes')
		print(pos1, pos2)


n = int(input())
a = list(map(int, input().split(' ')))
i = 0
idx1 = []
idx2 = -1
while i <= len(a) - 1:
	if (i + 1 < len(a) and a[i] > a[i + 1]) and (i - 1 < 0 or a[i - 1] < a[i]):
		idx1.append(i)
		idx2 = i
	if i - 1 >= 0 and a[i - 1] > a[i]:
		idx2 = i
	i += 1
if len(idx1) == 0 or (idx1[0] == idx2 and len(idx1) == 1):
	print('yes')
	print('1 1')
elif len(idx1) > 1 or (idx1[0] - 1 >= 0 and a[idx2] < a[idx1[0] - 1]) or (idx2 + 1 < len(a) and a[idx1[0]] > a[idx2 + 1]):
	print('no')
else:
	print('yes')
	print(idx1[0] + 1, idx2 + 1)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
c = []
for i in range(n):
	if a[i] != b[i]:
		c.append(i + 1)
if len(c) == 0:
	print('yes')
	print(1, 1)
elif len(c) >= 2:
	l = min(c)
	r = max(c)
	if list(reversed(a[l - 1:r])) == b[l - 1:r]:
		print('yes')
		print(l, r)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
k = l[:]
k.sort()
a = 77787878
b = 0
for i in range(n - 1):
	if l[i] > l[i + 1]:
		a = min(a, i)
	if i > a and l[i] < l[i + 1]:
		b = i
		break
	if i == n - 2:
		b = n - 1
		break
if l == k:
	print('yes')
	print(1, 1)
else:
	for i in range((b - a + 1) // 2):
		(l[a + i], l[b - i]) = (l[b - i], l[a + i])
	if l == k:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
a = b = c = 0
if l == sorted(l):
	print('yes')
	print('1 1')
elif l == sorted(l, reverse=True):
	print('yes')
	print('1', n)
else:
	for i in range(len(l) - 1):
		if l[i] > l[i + 1]:
			c = i
			break
	for i in range(c, len(l) - 1):
		if l[i] < l[i + 1]:
			b = i
			break
	if b != 0:
		l2 = list(l[:c] + list(reversed(l[c:b + 1])) + l[b + 1:])
	else:
		l2 = list(l[:c] + list(reversed(l[c:])))
	if l2 == sorted(l2) and b == 0:
		print('yes')
		print(c + 1, n)
	elif l2 == sorted(l2) and b != 0:
		print('yes')
		print(c + 1, b + 1)
	else:
		print('no')


N = int(input())
A = list(map(int, input().split()))

def solve1():
	B = sorted(A)
	L = -1
	R = -1
	i = 0
	while i < N:
		if A[i] != B[i]:
			if L == -1:
				L = i
			else:
				R = i
		i += 1
	if L == -1 and R == -1:
		print('yes')
		print('1 1')
	else:
		A[L:R + 1] = A[L:R + 1][::-1]
		i = 0
		while i < N:
			if A[i] != B[i]:
				print('no')
				break
			i += 1
		if i == N:
			print('yes')
			print('{0} {1}'.format(L + 1, R + 1))

def solve2():
	i = 0
	start = -1
	end = -1
	while i < N - 1:
		if A[i] > A[i + 1]:
			start = i
			break
		i += 1
	while i < N - 1:
		if A[i] < A[i + 1]:
			end = i
			break
		i += 1
	while i < N - 1:
		if A[i] > A[i + 1]:
			print('no')
			return
		i += 1
	if end == -1:
		end = N - 1
	if start == -1:
		print('yes')
		print('1 1')
	else:
		checkStart = start == 0 or A[end] > A[start - 1]
		checkEnd = end == N - 1 or A[start] < A[end + 1]
		if checkStart and checkEnd:
			print('yes')
			print('{0} {1}'.format(start + 1, end + 1))
		else:
			print('no')
solve2()


n = int(input())
l = [int(i) for i in input().split()]
l1 = sorted(l)
ans = []
for i in zip(l, l1):
	ans.append(i[0] == i[1])
if False in ans:
	rt = n - list(reversed(ans)).index(False) - 1
	lt = ans.index(False)
	l[lt:rt + 1] = l[lt:rt + 1][::-1]
	if l == l1:
		print('yes')
		print(lt + 1, rt + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


n = int(input())
l = list(map(int, input().split()))
temp = list(l)
temp.sort()
ans = []
flag = 0
for i in range(n):
	if temp[i] == l[i]:
		if flag == 1:
			ans.append((st, i - 1))
		flag = 0
	else:
		if flag == 0:
			st = i
		flag = 1
if flag == 1:
	ans.append((st, i))
if len(ans) == 0:
	print('yes')
	print(1, 1)
elif len(ans) < 3:
	if len(ans) == 1:
		(x, y) = (ans[0][0], ans[0][1])
	else:
		(x, y) = (ans[0][0], ans[1][1])
	temp[x:y + 1] = temp[x:y + 1][::-1]
	if temp == l:
		print('yes')
		print(x + 1, y + 1)
	else:
		print('no')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
flag = 0
l = -1
r = -1
if a == sorted(a):
	print('yes')
	print(1, 1)
else:
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			if l == -1:
				l = i
			r = i + 1
		else:
			if l != -1 and r != -1:
				if sorted(a) == a[:l] + a[l:r + 1][::-1] + a[r + 1:]:
					flag = 1
					break
			l = -1
			r = -1
	else:
		if l != -1 and r != -1:
			if sorted(a) == a[:l] + a[l:r + 1][::-1] + a[r + 1:]:
				flag = 1
	if flag == 1:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
p = input().rstrip().split(' ')
C = list(p)
G = 1
C.sort(key=int)
for i in range(0, len(p)):
	if int(p[i]) == int(C[i]):
		continue
	else:
		G = 1
		break
if G == 0:
	print(1)
	print(1, 1)
else:
	V = 0
	for i in range(0, len(p) - 1):
		if int(p[i]) > int(p[i + 1]):
			continue
		else:
			V = 1
			break
	if V == 0:
		print('yes')
		print(1, len(p))
	else:
		F = 0
		for i in range(0, len(p) - 1):
			if G == 1 and int(p[i]) > int(p[i + 1]):
				F = i
				break
		H = -41
		for i in range(F, len(p) - 1):
			if int(p[i]) < int(p[i + 1]):
				H = i
				break
		if H == -41:
			H = len(p) - 1
		if 1:
			B = p[F:H + 1]
			B.reverse()
			Q = []
			S = 0
			for i in range(0, len(p)):
				if i >= F and i <= H and (S < len(B)):
					Q.append(str(B[S]))
					S += 1
				else:
					Q.append(str(p[i]))
			if Q == C:
				print('yes')
				print(F + 1, H + 1)
			else:
				print('no')


n = int(input())
x = [int(q) for q in input().split()]
i = 1
while i < n and x[i] > x[i - 1]:
	i += 1
j = i
while j < n and x[j] < x[j - 1]:
	j += 1
left = i
right = j
s = x[:left - 1] + x[left - 1:right][::-1] + x[right:]
if x == sorted(x):
	print('yes')
	print(1, 1)
elif s == sorted(x):
	print('yes')
	print(left, right)
else:
	print('no')


_ = int(input())
testInp = input().split(' ')
origInp = list(map(int, testInp))
SorInp = list(map(int, testInp))
SorInp.sort()
goods = 0
rev = _ - 1
count = 0
if SorInp == origInp:
	print('yes')
	print('1 1')
else:
	while origInp[goods] == SorInp[goods]:
		goods += 1
	while origInp[rev] == SorInp[rev]:
		rev -= 1
	if origInp[goods:rev + 1] == SorInp[goods:rev + 1][::-1]:
		print('yes')
		print(1 + min(goods, rev), 1 + max(goods, rev))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
j = 0
l = -1
flag = False
for i in range(len(a)):
	if a[i] < j:
		if l == -1:
			l = i - 1
		r = i
		j = a[i]
		flag = True
	else:
		if flag:
			break
		j = a[i]
b = a
if l != -1:
	b = a[:l] + a[l:r + 1][::-1] + a[r + 1:]
if b == sorted(a):
	print('yes')
	if a == sorted(a):
		print('1 1')
	else:
		print(str(l + 1), str(r + 1))
else:
	print('no')


n = int(input())
l = [*map(int, input().split())]
start = -1
end = -1
for i in range(n - 1):
	if l[i] > l[i + 1]:
		start = i
		break
for i in range(n - 1, 0, -1):
	if l[i - 1] > l[i]:
		end = i
		break
l[start:end + 1] = l[start:end + 1][::-1]
flag = True
for i in range(n - 1):
	if l[i] <= l[i + 1]:
		continue
	else:
		flag = False
		break
if start == -1 and end == -1:
	print('yes')
	print(1, 1)
	exit()
if flag:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
arr = [int(i) for i in input().split()]
arr2 = list(arr)
arr.sort()
pos1 = 0
pos2 = 0
flag = 1
count = 0
for i in range(len(arr)):
	if arr[i] != arr2[i] and flag == 1:
		pos1 = i
		flag = 0
	if arr[i] != arr2[i]:
		pos2 = i
		count += 1
if count == 0:
	print('yes')
	print(1, 1)
else:
	arr2[pos1:pos2 + 1] = arr2[pos1:pos2 + 1][::-1]
	new = list(arr2)
	if new == arr:
		print('yes')
		print(pos1 + 1, pos2 + 1)
	else:
		print('no')


n = int(input())
l = [int(x) for x in input().split()]
l2 = []
for i in l:
	l2.append(i)
l2.sort()
if l == l2:
	print('yes')
	print(1, 1)
elif l[::-1] == l2:
	print('yes')
	print(1, n)
else:
	f = 0
	c = 0
	for i in range(n - 1):
		if l[i] >= l[i + 1] and f == 0:
			f = 1
			c += 1
		elif l[i] < l[i + 1]:
			f = 0
	if c > 2:
		print('no')
	else:
		f = 0
		for i in range(n):
			if l[i] != l2[i] and f == 0:
				a = i + 1
				f = 1
			elif l[i] != l2[i]:
				b = i + 1
		temp = []
		temp2 = l[a - 1:b]
		for i in range(b - 1, a - 2, -1):
			temp.append(l[i])
		temp2.sort()
		if temp == temp2:
			print('yes')
			print(a, b)
		else:
			print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
count = 0
positions = []
for i in range(n):
	if a[i] != b[i]:
		count += 1
		positions.append(i)
if len(positions) == 0:
	print('yes')
	print('1 1')
	exit()
begin = positions[0]
end = positions[-1]
a1 = a[begin:end + 1]
b1 = b[begin:end + 1]
c1 = sorted(b1, reverse=True)
for i in range(len(c1)):
	if a1[i] != c1[i]:
		print('no')
		exit()
print('yes')
print(begin + 1, end + 1)


n = int(input())
arr = [int(a) for a in input().split(' ')]
sorted_arr = sorted(arr)
start = -1
for i in range(len(arr) - 1):
	if arr[i] > arr[i + 1]:
		start = i
		break
end = -1
for i in range(start + 1, len(arr) - 1):
	if arr[i] < arr[i + 1]:
		end = i
		break
	if i == len(arr) - 2 and end == -1:
		end = len(arr) - 1
if len(arr) == 2 and end == -1:
	arr[0:2] = sorted(arr[0:2])
	start = 0
	end = 1
if len(arr) == 3 and end == -1:
	arr[1:3] = sorted(arr[1:3])
	start = 1
	end = 2
arr[start:end + 1] = sorted(arr[start:end + 1])
matched = True
for i in range(len(sorted_arr)):
	if sorted_arr[i] != arr[i]:
		matched = False
		break
if matched and start != -1 and (end != -1):
	print('yes')
	print(start + 1, end + 1)
elif matched:
	print('yes')
	print(1, 1)
else:
	print('no')


def inp():
	return int(input())

def inps():
	return map(int, input().split())
n = inp()
l = []
for i in inps():
	l.append(i)
(x, y, c, ci) = (0, 0, 0, -1)
for i in range(0, n):
	if l[i] < c:
		x = ci
		break
	(c, ci) = (l[i], i)
(c, ci) = (1000000009, 0)
for i in range(n - 1, -1, -1):
	if l[i] > c:
		y = ci
		break
	(c, ci) = (l[i], i)
xx = min(x, y)
yy = max(x, y)
for i in range(0, (yy - xx + 1) // 2):
	temp = l[xx + i]
	l[xx + i] = l[yy - i]
	l[yy - i] = temp
if l == sorted(l):
	print('yes')
	print(x + 1, y + 1)
else:
	print('no')


def issort(a):
	for k in range(len(a) - 1):
		if a[k] > a[k + 1]:
			return False
	return True
n = int(input())
a = list(map(int, input().split()))
(i, j) = (0, n - 1)
while i < n - 1 and a[i] < a[i + 1]:
	i += 1
while j > 0 and a[j] > a[j - 1]:
	j -= 1
if j == 0:
	print('yes')
	print(j + 1, j + 1)
elif issort(a[:i] + a[i:j + 1][::-1] + a[j + 1:]):
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split(' ')))
section = []
down = False
cannot_go_down = False
fail = False
for i in range(n - 1):
	if a[i] > a[i + 1]:
		if cannot_go_down:
			fail = True
			break
		section.append(i)
		down = True
	elif down:
		cannot_go_down = True
if len(section) == 0:
	print('yes')
	print('1', '1')
else:
	first_pos = section[0]
	last_pos = section[len(section) - 1] + 1
	if first_pos > 0 and a[last_pos] < a[first_pos - 1]:
		fail = True
	if last_pos < n - 1 and a[first_pos] > a[last_pos + 1]:
		fail = True
	if fail:
		print('no')
	else:
		print('yes')
		print(first_pos + 1, last_pos + 1)


df = int(input())
temp1 = 0
temp3 = 0
arr = list(map(int, input().split()))
arr1 = sorted(arr)
y = len(arr)
if sorted(arr) == arr[::-1]:
	print('yes')
	print(1, y)
else:
	for i in range(y - 1):
		if arr[i] > arr[i + 1]:
			temp1 = i
			break
	for i in range(temp1, y - 1):
		if arr[i] < arr[i + 1]:
			temp2 = i
			break
		else:
			temp2 = y - 1
	for i in range(temp2, y - 1):
		if arr[i] > arr[i + 1]:
			temp3 = 1
			break
	arr[temp1:temp2 + 1] = reversed(arr[temp1:temp2 + 1])
	if arr1 == arr and temp3 == 0:
		print('yes')
		print(temp1 + 1, temp2 + 1)
	else:
		print('no')


def issorted(a):
	for i in range(1, len(a)):
		if not a[i] >= a[i - 1]:
			return False
	return True
n = input()
l = list(map(int, input().split()))
if issorted(l):
	print('yes')
	print(1, 1)
	exit()
elif issorted(l[::-1]):
	print('yes', '{} {}'.format(1, len(l)), sep='\n')
	exit()
f = 0
bol = True
i = 1
start = 0
while i < len(l):
	if not l[i] >= l[i - 1]:
		if bol:
			bol = False
			start = i - 1
			while i < len(l) and l[i] <= l[i - 1]:
				f += 1
				i += 1
			if i == len(l):
				if l[-1] > l[start - 1]:
					print('yes')
					print(start + 1, len(l))
					exit()
				else:
					print('no')
					exit()
			if l[start] > l[start + f + 1]:
				print('no')
				exit()
		else:
			print('no')
			exit()
	i += 1
print('yes')
print(start + 1, start + f + 1)


def __init():
	n = int(input())
	a = input()
	a = a.split(' ')
	for i in range(n):
		a[i] = int(a[i])
	return (a, n)

def solve(a, n):
	L = 0
	R = 0
	count = 1
	A = sorted(a)
	for i in range(1, n):
		if A[i] != a[i] and a[i] > a[i - 1]:
			L = i
		elif A[i] != a[i] and a[i] < a[i - 1]:
			R = i
			count += 1
		elif a[i] < a[i - 1]:
			count += 1
	if R - L + 1 == count and A[L] == a[R] and (A[R] == a[L]):
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')
(a, n) = __init()
solve(a, n)


import copy
n = int(input())
a = [int(x) for x in input().split()]
anew = copy.deepcopy(sorted(a))
indexs = []
for i in range(n):
	if a[i] != anew[i]:
		indexs.append(i)
if indexs == []:
	print('yes')
	print(1, 1)
else:
	x = min(indexs)
	y = max(indexs)
	b = a[x:y + 1]
	c = b[::-1]
	if a[:x] + c + a[y + 1:] == anew:
		print('yes')
		print(x + 1, y + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
l1 = sorted(l)
x = -1
y = -1
for i in range(n):
	if l[i] != l1[i]:
		x = i
		break
for i in range(n - 1, -1, -1):
	if l[i] != l1[i]:
		y = i
		break
if x == -1 and y == -1:
	print('yes')
	print('1 1')
elif l1 == l[:x] + l[x:y + 1][::-1] + l[y + 1:]:
	print('yes')
	print(x + 1, y + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().rstrip().split()))
b = []
b = b + a
b.sort()
mini = float('inf')
r = 0
for i in range(n):
	if a[i] != b[i]:
		mini = min(i, mini)
		r = max(r, i)
if mini == float('inf') and r == 0:
	print('yes')
	print(1, 1)
	exit()
h = a[0:mini] + list(reversed(a[mini:r + 1])) + a[r + 1:]
if h == b:
	print('yes')
	print(mini + 1, r + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
p = []
for i in a:
	p.append(i)
p.sort()
if p == a:
	print('yes')
	print(str(1) + ' ' + str(1))
	quit()
l = -1
r = -1
for i in range(0, n):
	if l == -1:
		if i == 0:
			continue
		elif a[i] > a[i - 1]:
			continue
		else:
			l = i - 1
			r = i
	elif a[i] < a[i - 1]:
		r = i
	else:
		break
z = []
for i in range(l):
	z.append(a[i])
for i in range(r, l - 1, -1):
	z.append(a[i])
for i in range(r + 1, n):
	z.append(a[i])
a.sort()
if a == z:
	print('yes')
	print(str(l + 1) + ' ' + str(r + 1))
else:
	print('no')


n = int(input())
l = list(map(int, input().rstrip().split()))
b = sorted(l)
a = []
sums = 0
if l == b:
	print('yes')
	print(1, 1)
else:
	c = 0
	for i in range(n):
		if l[i] - b[i] != 0 or c == 1:
			if sums == 0 or sums + (l[i] - b[i]) == 0:
				c = 1
				a.append(i + 1)
				sums += l[i] - b[i]
				if sums == 0:
					c = 0
			elif sums != 0 and l[i] > l[i - 1]:
				print('no')
				break
	if sums == 0 and len(a) == 2:
		print('yes')
		print(*a)
	elif len(a) > 2:
		print('no')


def arraySortedOrNot(arr, n):
	if n == 0 or n == 1:
		return True
	for i in range(1, n):
		if arr[i - 1] > arr[i]:
			return False
	return True
n1 = input()
n1 = int(n1)
arr = list(map(int, input().rstrip().split()))
a = []
b = 1
i = 1
bb = 1
if arraySortedOrNot(arr, len(arr)):
	print('yes')
	print(b, bb)
else:
	while i < len(arr):
		if arr[i - 1] <= arr[i]:
			i = i + 1
			continue
		else:
			b = i
			j11 = i - 2
			while j11 > 0:
				if arr[j11] == arr[i - 1]:
					a.append(arr[j11])
					j11 = j11 - 1
				else:
					break
			f = j11
			i = b
			b = i
			while i < len(arr) and arr[i - 1] >= arr[i]:
				a.append(arr[i - 1])
				i = i + 1
			a.append(arr[i - 1])
			br = a[::-1]
			bb = i
			break
	k = arr[:f + 1] + br + arr[bb:]
	if arraySortedOrNot(k, len(k)):
		print('yes')
		print(f + 2, bb)
	else:
		print('no')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2
from math import *
for _ in range(1):
	n = int(input())
	arr = list(map(int, input().split()))
	temp = arr[:]
	temp1 = arr[:]
	(l, r) = (-1, -1)
	temp.sort()
	for i in range(n):
		if temp[i] == arr[i]:
			continue
		else:
			l = i
			break
	for i in range(n - 1, -1, -1):
		if temp[i] == arr[i]:
			continue
		else:
			r = i
			break
	if l == -1 and r == -1:
		print('yes')
		print('1 1')
	else:
		for i in range(r - l + 1):
			arr[l + i] = temp1[r - i]
		if arr == temp:
			print('yes')
			print(l + 1, r + 1)
		else:
			print('no')


n = int(input())
a = [int(x) for x in input().split()]
i = 0
count = 0
x = 1
y = 1
while i < n - 1:
	if a[i] > a[i + 1]:
		x = i + 1
		while i < n - 1 and a[i] >= a[i + 1]:
			i += 1
		count += 1
		y = i + 1
	else:
		i += 1
if a[:x - 1] + a[y - 1:x - 2 if x - 1 else None:-1] + a[y:] == sorted(a):
	print('yes')
	print(x, y)
else:
	print('no')


n = int(input())
l = [int(i) for i in input().split()]
i = 0

def issorted(l):
	return all((l[i] <= l[i + 1] for i in range(0, n - 1)))
if issorted(l):
	print('yes')
	print('1 1')
	exit()
c = 0
while i < n - 1:
	if l[i] > l[i + 1]:
		c += 1
		st = i
		while i < n - 1 and l[i] > l[i + 1]:
			i += 1
		end = i
	else:
		i += 1
if c > 1:
	print('no')
else:
	l1 = l[0:st] + l[st:end + 1][::-1] + l[end + 1:]
	if issorted(l1):
		print('yes')
		print(st + 1, end + 1)
	else:
		print('no')


class Solution:

	def sortTheArray(self, n, nums):
		sortedNums = sorted(nums)
		if sortedNums == nums:
			return [1, 1]
		leftPos = 0
		rightPos = n - 1
		while leftPos < n - 1:
			if nums[leftPos] < nums[leftPos + 1]:
				leftPos += 1
			else:
				break
		while rightPos > 1:
			if nums[rightPos] > nums[rightPos - 1]:
				rightPos -= 1
			else:
				break
		newReverse = nums[:leftPos] + nums[leftPos:rightPos + 1][::-1] + nums[rightPos + 1:]
		if sortedNums == newReverse:
			return [leftPos + 1, rightPos + 1]
		return -1
n = 3
nums = [3, 2, 1]
[1, 2, 3]
n = 4
nums = [2, 1, 3, 4]
n = 4
nums = [3, 1, 2, 4]
n = 2
nums = [1, 2]
n = 6
nums = [1, 3, 4, 2, 5, 6]
n = 8
nums = [1, 2, 3, 9, 8, 7, 6, 5]
n = 40
nums = [42131757, 49645896, 49957344, 78716964, 120937785, 129116222, 172128600, 211446903, 247833196, 779340466, 717548386, 709969818, 696716905, 636153997, 635635467, 614115746, 609201167, 533608141, 521874836, 273044950, 291514539, 394083281, 399369419, 448830087, 485128983, 487192341, 488673105, 497678164, 501864738, 265305156, 799595875, 831638598, 835155840, 845617770, 847736630, 851436542, 879757553, 885618675, 964068808, 969215471]
n = int(input())
nums = list(map(int, input().split()))
solution = Solution()
result = solution.sortTheArray(n, nums)
if result != -1:
	print('yes')
	print('{} {}'.format(result[0], result[1]))
else:
	print('no')


n = int(input())
x = list(map(int, input().split()))
b = x.copy()
b.sort()
(l, r, c) = (1, 1, [])
for i in range(len(x)):
	if x[i] != b[i]:
		c.append(i + 1)
if len(c) > 0:
	(l, r) = (min(c), max(c))
if list(reversed(x[l - 1:r])) == b[l - 1:r]:
	print('yes')
	print(l, r)
else:
	print('no')


n = int(input())
ar = list(map(int, input().split()))
k = 0
dp = [1] * n
for i in range(1, n):
	if ar[i] < ar[i - 1]:
		dp[i] = 1 + dp[i - 1]
m = max(dp)
e = dp.index(m)
s = e - m + 1
ans = ar[0:s] + ar[e:s:-1] + ar[s:s + 1] + ar[e + 1:n]
if sorted(ans) == ans:
	print('yes')
	print(s + 1, e + 1)
else:
	print('no')


n = int(input())
t = list(map(int, input().split()))
p = sorted(t)
a = b = 0
for i in range(n):
	if t[i] != p[i]:
		(a, b) = (i, n - 1)
		while t[b] == p[b]:
			b -= 1
		break
b += 1
print('yes\n' + str(a + 1) + ' ' + str(b) if t[a:b] == p[a:b][::-1] else 'no')


def p():
	prev = arr[0]
	for i in range(1, n):
		if arr[i] < prev:
			st = i
			prev2 = arr[i]
			for j in range(i + 1, n):
				if arr[j] > prev2:
					temp = arr.copy()
					temp[st - 1:j] = temp[st - 1:j][::-1]
					if all((temp[i] <= temp[i + 1] for i in range(n - 1))):
						print('yes')
						print(st, j)
						return True
					else:
						return
				prev2 = arr[j]
			temp = arr.copy()
			temp[st - 1:n] = temp[st - 1:n][::-1]
			if all((temp[i] <= temp[i + 1] for i in range(n - 1))):
				print('yes')
				print(st, n)
				return True
			else:
				return
		prev = arr[i]
n = int(input())
arr = [int(i) for i in input().split()]
if all((arr[i] <= arr[i + 1] for i in range(n - 1))):
	print('yes\n1 1')
elif not p():
	print('no')


def isSorted(l):
	flag = 0
	for i in range(len(l) - 1):
		if l[i] < l[i + 1]:
			f = 1
		else:
			f = 0
			break
	if f == 0:
		return False
	return True

def isReverseSorted(l):
	f = 0
	for i in range(len(l) - 1):
		if l[i] > l[i + 1]:
			f = 1
		else:
			f = 0
			break
	if f == 0:
		return False
	return True
n = int(input())
l = [int(x) for x in input().split()]
if n == 1:
	print('yes')
	print(1, 1)
elif isSorted(l):
	print('yes')
	print(1, 1)
elif isReverseSorted(l):
	print('yes')
	print(1, n)
else:
	low = -1
	high = -1
	for i in range(len(l) - 1):
		if l[i + 1] < l[i]:
			low = i
			break
	for i in range(low + 1, len(l) - 1):
		if l[i + 1] > l[i]:
			high = i
			break
	if high == -1:
		high = n - 1
	l[low:high + 1] = l[low:high + 1][::-1]
	if l == sorted(l):
		print('yes')
		print(low + 1, high + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
if a == sorted(a):
	print('yes')
	print(1, 1)
else:
	i = 0
	temp = []
	while a[i + 1] > a[i]:
		i += 1
	l = l1 = i
	while i < n - 1 and a[i + 1] < a[i]:
		temp.append(a[i])
		i += 1
	temp.append(a[i])
	r = i
	temp.reverse()
	for item in temp:
		a[l] = item
		l += 1
	if a == sorted(a):
		print('yes')
		print(l1 + 1, r + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
	b.append(a[i])
b.sort()
l = 0
r = 0

def Swap(a, b):
	temp = a
	a = b
	b = temp
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		r = i
		break
if l > r:
	print('no')
elif l == r:
	print('yes')
	print('1 1')
else:
	ll = l
	rr = r
	l += 1
	r += 1
	while ll <= rr:
		(a[ll], a[rr]) = (a[rr], a[ll])
		ll += 1
		rr -= 1
	if a == b:
		print('yes')
		print(l, end=' ')
		print(r)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
l = 0
r = 1
yep = False
if a[::-1] == sorted(a):
	print('yes')
	print(1, len(a))
elif a == sorted(a):
	print('yes')
	print(1, 1)
else:
	for i in range(n - 1):
		if a[i] > a[i + 1] and (not yep):
			l = i
			break
	for i in range(n - 1, 0, -1):
		if a[i] < a[i - 1]:
			r = i
			break
	if a[:l] + a[l:r + 1][::-1] + a[r + 1:] == sorted(a):
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
start = 0
end = 0
asc = True
descArr = 0
nt = True
for x in range(0, n - 1):
	if arr[x] < arr[x + 1] and asc:
		continue
	elif arr[x] > arr[x + 1] and asc:
		start = x
		end = x + 1
		asc = False
		descArr = descArr + 1
		if descArr > 1:
			break
	elif arr[x] > arr[x + 1] and asc == False:
		end = end + 1
	elif arr[x] < arr[x + 1] and asc == False:
		if arr[x + 1] < arr[start]:
			nt = False
			break
		asc = True
if descArr > 1:
	print('no')
elif descArr == 0:
	print('yes')
	print(start + 1, end + 1)
elif descArr == 1 and nt:
	if start == 0:
		print('yes')
		print(start + 1, end + 1)
	elif arr[start - 1] < arr[end]:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')
else:
	print('no')


n = int(input())
arr = [int(x) for x in input().split()]
temp = sorted(arr)
start = -1
end = -1
for i in range(n):
	if arr[i] != temp[i]:
		start = i
		break
for i in range(n - 1, -1, -1):
	if arr[i] != temp[i]:
		end = i
		break
if start == -1 and end == -1:
	print('yes')
	print(1, 1)
elif temp[start:end + 1][::-1] == arr[start:end + 1]:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


_ = int(input())
arr = list(map(int, input().split()))
(start, end) = (None, None)
for k in range(1, len(arr)):
	if arr[k - 1] > arr[k]:
		start = k - 1
		m = k - 1
		while m + 1 < len(arr) and arr[m] > arr[m + 1]:
			m += 1
		end = m
	if start is not None:
		break
if start is None and end is None:
	print('yes')
	print('1 1')
elif arr[:start] + arr[start:end + 1][::-1] + (arr[end + 1:] if end + 1 <= len(arr) else []) == sorted(arr):
	print('yes')
	print(f'{start + 1} {end + 1}')
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
f = sorted(l)
ans = []
res = []
d = {}
if l == f:
	print('yes')
	print('1 1')
else:
	for i in range(1, n + 1):
		d[l[i - 1]] = i
	for i in range(n):
		if l[i] != f[i]:
			ans.append(l[i])
	f = l[:d[ans[0]] - 1] + l[d[ans[0]] - 1:d[ans[-1]]][::-1] + l[d[ans[-1]]:]
	if f == sorted(l):
		print('yes')
		print(d[ans[0]], d[ans[-1]])
	else:
		print('no')


def _reverse(arr, left, right):
	n = len(arr)
	return arr[:left] + arr[-n + right:-n + left - 1:-1] + arr[right + 1:]

def check(arr):
	n = len(arr)
	for i in range(1, n):
		if arr[i] < arr[i - 1]:
			return False
	return True
t = int(input())
arr = [[-1 * 10 ** 10, 0], [-1 * 10 ** 10 + 1, 1]]
val = []
_number = 2
for i in input().split():
	val.append(int(i))
	arr.append([int(i), _number])
	_number += 1
arr.append([10 ** 10, t + 2])
arr.append([10 ** 10 + 1, t + 3])
t += 4
if check(val):
	print('yes\n1 1')
	exit(0)
arr.sort()
left = 1
for i in range(1, t):
	if arr[i - 1][1] + 1 == arr[i][1]:
		left = i
	else:
		break
right = t - 2
for i in range(t - 2, 0, -1):
	if arr[i + 1][1] - 1 == arr[i][1]:
		right = i
	else:
		break
(left, right) = (arr[right - 1][1] - 2, arr[left + 1][1] - 2)
flag = False
if left <= right:
	val = _reverse(val, left, right)
	flag = check(val)
if not flag:
	print('no')
else:
	print('yes\n%d %d' % (left + 1, right + 1))


n = int(input())
arr = [0] + [int(x) for x in input().split()] + [1000000001]
res = []
start = -1
end = -1
for i in range(1, n + 2):
	if start == -1 and arr[i - 1] > arr[i]:
		start = i - 1
	elif start != -1 and arr[i - 1] < arr[i]:
		end = i - 1
		res = arr[:start] + arr[i - 1:start:-1] + [arr[start]] + arr[i:]
		break
if start == -1:
	print('yes')
	print(1, 1)
	exit(0)
for i in range(1, n + 2):
	if res[i - 1] > res[i]:
		print('no')
		exit(0)
print('yes')
print(start, end)


n = int(input())
ar = list(map(int, input().split()))

def sortar(ar):
	arr = ar[:]
	arr.sort()
	start = 0
	end = len(ar) - 1
	if ar == arr:
		print('yes')
		print(1, 1)
		return
	else:
		for i in range(len(ar)):
			if ar[i] > ar[i + 1]:
				start = i
				for j in range(len(ar) - 1, i - 1, -1):
					if ar[j] < ar[j - 1]:
						end = j
						break
				break
		arrr = ar[start:end + 1]
		arrr.reverse()
		ar = ar[:start] + arrr + ar[end + 1:]
		if ar == arr:
			print('yes')
			print(start + 1, end + 1)
		else:
			print('no')
sortar(ar)


n = int(input())
l = list((int(i) for i in input().split()))
k = sorted(l)
(c, d) = (0, 0)
for i in range(len(l)):
	if l[i] == k[i]:
		continue
	else:
		c = c + i
		break
for i in range(len(l) - 1, 0, -1):
	if l[i] == k[i]:
		continue
	else:
		d = d + i
		break
if c == 0:
	m = l[:c] + l[d::-1] + l[d + 1:]
else:
	m = l[:c] + l[d:c - 1:-1] + l[d + 1:]
if k == m:
	print('yes')
	print(c + 1, d + 1)
else:
	print('no')


n = int(input())
x = list(map(int, input().split()))
y = x[:]
y.sort()
l = -1
r = -1
for i in range(n):
	if x[i] != y[i]:
		l = i
		break
for i in range(n - 1, 0, -1):
	if x[i] != y[i]:
		r = i
		break
x = x[:l] + x[l:r + 1][::-1] + x[r + 1:]
if l == -1:
	print('yes\n1 1')
elif x != y:
	print('no')
else:
	print('yes')
	print(l + 1, r + 1)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
Arr = get_array()
i = 1
flag = 0
while i < n:
	if Arr[i] >= Arr[i - 1]:
		i += 1
	else:
		flag = 1
		start = i - 1
		break
if flag == 0:
	print('yes')
	print(1, 1)
	exit()
for i in range(start + 1, n):
	if Arr[i] <= Arr[i - 1]:
		stop = i
	else:
		continue
new_Arr = Arr[:start] + Arr[start:stop + 1][::-1] + Arr[stop + 1:]
Arr.sort()
if new_Arr == Arr:
	print('yes')
	print(start + 1, stop + 1)
else:
	print('no')


n = int(input())
a = [int(i) for i in input().split()]
mode = 0
max0 = 0
min1 = 0
max1 = 0
min2 = 1000000007
flag = 0
for i in range(n - 1):
	dif = a[i + 1] - a[i]
	if dif < 0:
		if mode == 2:
			print('no')
			flag = 1
			break
		elif mode == 0:
			mode = 1
			min1 = i
			if i > 0:
				max0 = a[i - 1]
		elif mode == 1:
			max1 = i
	elif dif >= 0:
		if mode == 1:
			mode = 2
			max1 = i
			min2 = a[i + 1]
if mode == 1:
	max1 = n - 1
if flag == 0:
	if a[max1] >= max0 and a[min1] <= min2:
		print('yes')
		print(min(min1, max1) + 1, max(min1, max1) + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
if a == sorted(a):
	print('yes')
	print(1, 1)
	exit()
left = 1
for (i, el) in enumerate(a[1:]):
	if el >= a[i]:
		left += 1
	else:
		break
right = n
for (i, el) in enumerate(a[:-1][::-1], 1):
	if el <= a[n - i]:
		right -= 1
	else:
		break
if a[:left - 1] + a[left - 1:right][::-1] + a[right:] == sorted(a):
	print('yes')
	print(left, right)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
l = r = 0
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
for j in range(n - 1, -1, -1):
	if a[j] != b[j]:
		r = j
		break
i = l
j = r
while i <= j:
	(a[i], a[j]) = (a[j], a[i])
	i += 1
	j -= 1
if a == b:
	print('yes')
	print('{0} {1}'.format(l + 1, r + 1))
else:
	print('no')


n = int(input())
arr = list(map(int, input().split()))
test = sorted(arr)
start = None
end = None
for i in range(n):
	if start == None and arr[i] != test[i]:
		start = i
		continue
	if arr[i] != test[i]:
		end = i
if start == None and end == None:
	print('yes')
	print(1, 1)
	exit(0)
arr = arr[:start] + arr[start:end + 1][::-1] + arr[end + 1:]
for i in range(n):
	if arr[i] != test[i]:
		print('no')
		exit(0)
print('yes')
print(start + 1, end + 1)


n = int(input())
arr = list(map(int, input().split()))
dup = arr[:]
dup = sorted(dup)
exist = False
for i in range(1, n):
	if arr[i] < arr[i - 1]:
		exist = True
		index = i
if not exist:
	print('yes')
	print(1, 1)
else:
	i2 = dup.index(arr[index])
	d = arr[i2:index + 1]
	d = d[::-1]
	di = 0
	for i in range(n):
		if i2 <= i <= index:
			arr[i] = d[di]
			di += 1
	if arr == dup:
		print('yes')
		print(i2 + 1, index + 1)
	else:
		print('no')


(z, a, n, m) = (int(input()), list(map(int, input().split())), 0, 0)
b = sorted(a)
if a != b:
	for n in range(z):
		if a[n] != b[n]:
			break
	for m in range(z - 1, -1, -1):
		if a[m] != b[m]:
			break
	if a[:n] + a[n:m + 1][::-1] + a[m + 1:] == b:
		print('yes\n%d %d' % (n + 1, m + 1))
	else:
		print('no')
else:
	print('yes\n1 1')


input1 = input()
input = input().split()
a = []
for i in range(len(input)):
	a.append(int(input[i]))
if len(a) == 1:
	print('yes\n1 1')
else:
	possible = True
	index1 = 0
	index2 = 0
	increasing = True
	switch_1 = False
	switch_2 = False
	if a[1] < a[0]:
		increasing = False
		index2 = len(a) - 1
	for i in range(len(a) - 1):
		if increasing:
			if a[i] > a[i + 1]:
				if switch_2:
					possible = False
				index1 = i
				switch_1 = True
				increasing = False
		elif a[i] < a[i + 1]:
			index2 = i
			switch_2 = True
			increasing = True
	if index2 < index1:
		index2 = len(a) - 1
	n1 = -1
	n2 = 0
	j = index2 - index1
	for i in range(len(a)):
		n1 = n2
		if i <= index2 and i >= index1:
			n2 = a[i + j]
			j -= 2
		else:
			n2 = a[i]
		if i != 0 and n1 > n2:
			possible = False
	if possible:
		print(f'yes\n{index1 + 1} {index2 + 1}')
	else:
		print('no')


n = int(input())
lst = [int(x) for x in input().split()]
for i in range(n - 1):
	if lst[i] > lst[i + 1]:
		l = i
		break
else:
	l = 0
for i in range(l, n - 1):
	if lst[i] < lst[i + 1]:
		h = i
		break
else:
	h = n - 1
lst = [0] + lst + [10 ** 9 + 1]
h += 1
l += 1
for i in range(h + 1, n + 1):
	if lst[i] > lst[i + 1]:
		print('no')
		break
else:
	if lst[l] <= lst[h + 1] and lst[h] >= lst[l - 1]:
		print('yes')
		print(l, h)
	else:
		print('no')


n = int(input())
flag = 0
start = 0
end = 0
a = [int(i) for i in input().split()]
for i in range(0, len(a) - 1):
	if a[i] > a[i + 1] and flag == 0:
		start = i
		end = i + 1
		flag = 1
	elif a[i] > a[i + 1] and flag > 0:
		end = i + 1
	elif flag == 0:
		pass
	else:
		break
l = a[0:start] + a[start:end + 1][::-1] + a[end + 1:]
if l == sorted(l):
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
arr = list(map(int, input().split()))
l = 0
boo = False
s = 0
best = [0, 0]
for i in range(n - 1):
	if arr[i + 1] <= arr[i] and boo == False:
		l += 1
		s = i
		boo = True
	elif arr[i + 1] <= arr[i] and boo == True:
		l += 1
	elif arr[i + 1] > arr[i] and boo == True:
		break
brr = arr[s:s + l + 1][::-1]
brr = arr[:s] + brr + arr[s + l + 1:]
arr.sort()
if brr == arr:
	print('yes')
	print(s + 1, s + 1 + l)
else:
	print('no')


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
l = il()
lsrt = sorted(l[:])
(a, b) = (-1, -1)
for i in range(n):
	if l[i] != lsrt[i]:
		a = i
		break
for i in range(n - 1, -1, -1):
	if l[i] != lsrt[i]:
		b = i
		break
if a == b == -1:
	print('yes')
	print(1, 1)
elif l[:a] + l[a:b + 1][::-1] + l[b + 1:] == lsrt:
	print('yes')
	print(a + 1, b + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
R = L = 0
for i in range(n - 1):
	if a[i] > a[i + 1]:
		L = i
		break
for i in range(n - 1, 0, -1):
	if a[i] < a[i - 1]:
		R = i
		break
if R is 0 and L is n - 1:
	print('yes')
	print('1 1')
else:
	flag = 1
	a[L:R + 1] = reversed(a[L:R + 1])
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			flag = 0
			break
	if flag is 1:
		print('yes')
		print(L + 1, R + 1, end=' ')
	else:
		print('no')


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	n = int(input())
	arr = array()
	ans = sorted(arr)
	l = None
	for i in range(n - 1):
		if l == None and arr[i] > arr[i + 1]:
			l = i
			r = i + 1
		elif l != None and arr[i] > arr[i + 1]:
			r += 1
	if l == None:
		l = 0
		r = 0
	arr[l:r + 1] = arr[l:r + 1][::-1]
	if arr == ans:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')
t = 1
for _ in range(t):
	main()


n = int(input())
a = list(map(int, input().split(' ')))
b = sorted(a)
l = a
d = 0
e = 0
c = 0
if a != b:
	for x in range(0, n):
		if a[x] != b[x]:
			d = x
			break
	for x in range(n - 1, -1, -1):
		if a[x] != b[x]:
			e = x
			c = 1
			break
	x = d
	y = e
	while x < y:
		tmp = a[x]
		a[x] = a[y]
		a[y] = tmp
		x += 1
		y -= 1
	if a == b:
		print('yes')
		print(f'{d + 1} {e + 1}')
	else:
		print('no')
elif a == b:
	print('yes')
	print('1 1')
else:
	exit()


n = int(input())
vetor = list(map(int, input().split()))
vetor_sorted = sorted(vetor)
if vetor == vetor_sorted:
	print('yes')
	print('1 1')
else:
	left_index = 0
	rigth_index = n - 1
	for i in range(n):
		if vetor[i] != vetor_sorted[i]:
			left_index = i
			break
	for i in range(n - 1, -1, -1):
		if vetor[i] != vetor_sorted[i]:
			rigth_index = i
			break
	vetor_aux = vetor[:left_index] + vetor[left_index:rigth_index + 1][::-1] + vetor[rigth_index + 1:]
	if vetor_aux == vetor_sorted:
		print('yes')
		print('{} {}'.format(left_index + 1, rigth_index + 1))
	else:
		print('no')


n = int(input())
arr = [int(a) for a in input().split(' ')]
arrsort = [element for element in arr]
arrsort.sort()
if arrsort == arr:
	print('yes')
	print('1 1')
else:
	if arr[0] < arr[1]:
		aum = True
		indexi = 0
		indexd = n - 1
	else:
		aum = False
		indexd = 0
		indexi = n - 1
	for i in range(1, n - 1):
		if arr[i] < arr[i + 1] and (not aum):
			indexi = i
			aum = True
		elif arr[i] > arr[i + 1] and aum:
			indexd = i
			aum = False
	if not aum:
		indexi = n - 1
	last = arr[indexd:indexi + 1]
	ans = arr[:indexd] + last[::-1] + arr[indexi + 1:]
	if ans == arrsort:
		print('yes')
		print(indexd + 1, indexi + 1)
	else:
		print('no')


n = int(input())
numbers = [int(i) for i in input().split()]
i = 1
while i < len(numbers) and numbers[i] >= numbers[i - 1]:
	i += 1
j = len(numbers) - 1
while j > 0 and numbers[j] >= numbers[j - 1]:
	j -= 1
i -= 1
if not j:
	print('yes')
	print(1, 1)
else:
	rev = numbers[i:j + 1]
	rev.reverse()
	sd = numbers[:i] + rev + numbers[j + 1:]
	if sd == sorted(numbers):
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


num = int(input())
array = [int(x) for x in input().split(' ')]

def verify_sorting(num, array):
	decreasing = False
	start = -1
	end = -1
	for i in range(num - 1):
		if array[i] > array[i + 1] and decreasing == False:
			decreasing = True
			start = i + 1
		elif array[i] < array[i + 1] and decreasing == True:
			end = i + 1
			break
	if start == -1 and end == -1:
		start = 1
		end = 1
	elif end == -1 and start != -1:
		end = num
	if start == 1:
		temp = array[:start - 1] + array[end - 1::-1] + array[end:]
	else:
		temp = array[:start - 1] + array[end - 1:start - 2:-1] + array[end:]
	for k in range(num - 1):
		if temp[k] > temp[k + 1]:
			print('no')
			return
	print('yes')
	print('{} {}'.format(start, end))
verify_sorting(num, array)


n = int(input())
array = [int(x) for x in input().split()]
arraySort = array.copy()
arraySort.sort()
(l, r) = (0, 0)
for i in range(n - 1):
	if array[i] > array[i + 1]:
		l = i
		break
for i in range(n - 1, 0, -1):
	if array[i] < array[i - 1]:
		r = i
		break
aux = []
for i in range(r, l - 1, -1):
	aux.append(array[i])
if aux == arraySort[l:r + 1]:
	print('yes')
	print('%d %d' % (l + 1, r + 1))
else:
	print('no')


import sys
input = sys.stdin.readline
read_tuple = lambda _type: map(_type, input().split(' '))

def print_ans(ans, l=None, r=None):
	print(ans)
	if l and r:
		print(l, r)

def solve():
	n = int(input())
	a = list(read_tuple(int))
	disorder = []
	for i in range(1, n):
		if a[i - 1] > a[i]:
			if not disorder or disorder[-1] != i - 1:
				disorder.append(i - 1)
				disorder.append(i)
			else:
				disorder[-1] = i
	if not disorder:
		print_ans('yes', 1, 1)
	elif len(disorder) == 2:
		(l, r) = disorder
		left_a = a[0:l]
		sub_a = a[l:r + 1]
		right_a = a[r + 1:n]
		if left_a + list(reversed(sub_a)) + right_a == sorted(a):
			print_ans('yes', l + 1, r + 1)
		else:
			print_ans('no')
	else:
		print_ans('no')
solve()


n = int(input())
l = list(map(int, input().split()))
s = sorted(l)
flag = 0
(index1, index2) = (0, 0)
for i in range(n):
	if l[i] != s[i]:
		f = s.index(l[i])
		x = l[i:f + 1]
		index1 = i + 1
		index2 = f + 1
		x.reverse()
		l[i:f + 1] = x
		break
flag = 0
for i in range(n):
	if l[i] != s[i]:
		flag = 1
		break
if flag == 1:
	print('no')
else:
	print('yes')
	if index1 == 0 and index2 == 0:
		print(index1 + 1, index2 + 1)
	else:
		print(index1, index2)


n = int(input())
a = list(map(int, input().split()))
l = -1
r = -1
for i in range(n - 1):
	if a[i] > a[i + 1]:
		l = i
		break
for j in range(l, n - 1):
	if a[j] < a[j + 1]:
		r = j
		break
if r == -1:
	r = n - 1
if l == -1:
	l = 0
ans = a[:l] + a[l:r + 1][::-1] + a[r + 1:]
a.sort()
if ans == a:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


import sys
n = input().split()[0]
n = int(n)
alist = input().split()
alist.insert(0, -1)
alist.append(1000000000.0 + 1)
ans = 1
flag1 = flag2 = -1
n = n + 2
for i in range(n - 1):
	if int(alist[i]) > int(alist[i + 1]):
		flag1 = i
		break
	else:
		continue
if flag1 == -1:
	print('yes\n1 1\n')
	return
for i in range(flag1 + 1, n - 1):
	if int(alist[i]) < int(alist[i + 1]):
		flag2 = i
		break
	else:
		continue
if flag2 == -1:
	print('yes\n%d %d\n' % (flag1 + 1, n - 1))
	return
for i in range(flag2 + 1, n - 1):
	if int(alist[i]) > int(alist[i + 1]):
		print('no\n')
		return
if int(alist[flag2]) < int(alist[flag1 - 1]) or int(alist[flag1]) > int(alist[flag2 + 1]):
	print('no\n')
	return
print('yes\n%d %d\n' % (flag1, flag2))


n = int(input())
b = list(map(int, input().split()))
a = b.copy()
b.sort()
l = 0
r = 0
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		r = i
		break
a[l:r + 1] = a[l:r + 1][::-1]
if a == b:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
a = [int(x) for x in input().split()]

def sort1(a, x1, x2):
	x1 = 0
	x2 = n - 1
	for i in range(n):
		if a[i] >= a[x1]:
			x1 = i
		else:
			break
	for i in range(n):
		if a[n - i - 1] <= a[x2]:
			x2 = n - i - 1
		else:
			break
	return (x1, x2)

def resort(a, x1, x2):
	n = (x2 - x1) // 2 + 1
	for i in range(n):
		c = a[x1 + i]
		a[x1 + i] = a[x2 - i]
		a[x2 - i] = c
	return a
(y1, y2) = sort1(a, 0, n - 1)
if y1 == n - 1 and y2 == 0:
	print('yes\n1 1')
else:
	a = resort(a, y1, y2)
	(z1, z2) = sort1(a, 0, n - 1)
	if z1 == n - 1 and z2 == 0:
		print('yes\n' + str(y1 + 1), str(y2 + 1))
	else:
		print('no')


n = int(input())
c = 0
b = []
p = []
ans = ''
f = 0
L = -1
R = -1
a = list(map(int, input().split()))
for i in range(0, n - 1):
	if a[i + 1] < a[i]:
		L = i
		break
for i in range(n - 1, 0, -1):
	if a[i] < a[i - 1]:
		R = i
		break
if L == -1 or R == -1:
	print('yes')
	print(1, 1)
else:
	a[L:R + 1] = reversed(a[L:R + 1])
	if a == sorted(a):
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
l = a[0]
i = 0
while i < n - 1 and a[i] < a[i + 1]:
	i += 1
if i == n - 1:
	print('yes')
	print(1, 1)
else:
	j = i
	while j < n - 1 and a[j] > a[j + 1]:
		j += 1
	if j == n - 1:
		if i == 0:
			print('yes')
			print(i + 1, n)
		elif a[i - 1] < a[n - 1]:
			print('yes')
			print(i + 1, n)
		else:
			print('no')
	else:
		k = j
		while k < n - 1 and a[k] < a[k + 1]:
			k += 1
		if k == n - 1:
			if i == 0:
				if a[0] < a[j + 1]:
					print('yes')
					print(1, j + 1)
				else:
					print('no')
			elif a[i - 1] < a[j - 1] and a[i] < a[j + 1]:
				print('yes')
				print(i + 1, j + 1)
			else:
				print('no')
		else:
			print('no')


n = int(input())
a = list(map(int, input().split()))

def Reverse(a, l, r):
	(i, j) = (l, r)
	while i < j:
		(a[i], a[j]) = (a[j], a[i])
		i += 1
		j -= 1

def IsSorted(a):
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			return False
	return True
for l in range(n - 1):
	if a[l] > a[l + 1]:
		r = l + 1
		while r + 1 < n and a[r] > a[r + 1]:
			r += 1
		Reverse(a, l, r)
		if IsSorted(a):
			print('yes')
			print(l + 1, r + 1)
		else:
			print('no')
		break
else:
	print('yes')
	print(1, 1)


def sort_array_permutations(array):
	start = end = 0
	for i in range(len(array) - 1):
		if array[i] > array[i + 1]:
			start = i
			while i < len(array) - 1 and array[i] > array[i + 1]:
				i += 1
			end = i
			break
	array = array[0:start] + list(reversed(array[start:end + 1])) + array[end + 1:]
	is_sorted = all((array[i] <= array[i + 1] for i in range(len(array) - 1)))
	return 'yes' + '\n' + str(start + 1) + ' ' + str(end + 1) if is_sorted else 'no'
_ = input()
array = [int(e) for e in input().split()]
print(sort_array_permutations(array))


n = int(input())
s = list(map(int, input().split()))
first = -1
last = -1
cnt = 0
for i in range(n - 1):
	if s[i] > s[i + 1] and first == -1:
		first = i
	if first != -1 and s[i + 1] <= s[i]:
		last = i + 1
	if last == -1 and first != -1 and (i == n - 2):
		last = n - 1
if first == -1 and s == sorted(s):
	print('yes')
	print(1, 1)
else:
	newarr = s[0:first] + s[first:last + 1][::-1] + s[last + 1:n]
	if newarr == sorted(s):
		print('yes')
		print(first + 1, last + 1)
	else:
		print('no')


n = int(input())
L = list(map(int, input().split()))
T = L[:]
T.sort()
d = 0
i = 0
while i < n - 1:
	if L[i + 1] < L[i]:
		d = i
		break
	i += 1
if i == n - 1:
	print('yes')
	print('1 1')
else:
	f = 0
	while i < n - 1:
		if L[i + 1] > L[i]:
			f = i
			break
		i += 1
	if i == n - 1:
		f = n - 1
	if 1:
		S = L[d:f + 1]
		S.sort()
		N = L[:d] + S + L[f + 1:]
		L.sort()
		ok = 1
		i = 0
		while i < n:
			if L[i] != N[i]:
				print('no')
				ok = 0
				break
			i += 1
		if ok == 1:
			print('yes')
			print(str(d + 1) + ' ' + str(f + 1))


n = int(input())
a = list(map(int, input().split()))
b = sorted(a, reverse=False)
pos1 = pos2 = n
flag = 0
cnt = 0
for i in range(n):
	if a[i] != b[i]:
		pos1 = i
		cnt += 1
		break
if cnt == 0:
	print('yes')
	print(1, 1)
	exit()
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		pos2 = i
		break
if pos1 == n or pos2 == n or pos2 < pos1:
	flag = -1
j = pos2
for i in range(pos1, pos2):
	if a[i] != b[j]:
		flag = -1
		break
	j -= 1
if flag == 0:
	print('yes')
	print(pos1 + 1, pos2 + 1)
else:
	print('no')


n = int(input())
array = list(map(int, input().split(' ')))
indexs = []
pode_da_rock = True
for i in range(n - 1):
	if array[i] > array[i + 1]:
		indexs.append(i)
		break
if len(indexs) == 0:
	print('yes')
	print('%d %d' % (1, 1))
else:
	for j in range(indexs[0] + 1, n - 1):
		if array[j] < array[j + 1]:
			if array[j + 1] > array[indexs[0]]:
				indexs.append(j)
				break
			elif array[j + 1] < array[indexs[0]]:
				pode_da_rock = False
				break
	if pode_da_rock and len(indexs) == 1:
		if indexs[0] == 0:
			print('yes')
			print('%d %d ' % (1, n))
		elif array[indexs[0] - 1] < array[-1]:
			print('yes')
			print('%d %d' % (indexs[0] + 1, n))
		elif array[indexs[0] - 1] > array[-1]:
			print('no')
	else:
		if pode_da_rock:
			for k in range(indexs[1] + 1, n - 1):
				if array[k] > array[k + 1]:
					pode_da_rock = False
					break
		if pode_da_rock:
			print('yes')
			print('%d %d' % (indexs[0] + 1, indexs[1] + 1))
		else:
			print('no')


n = int(input())
l = list(map(int, input().split()))
l1 = []
l1 = sorted(l)
l2 = []
l3 = []
if l == l1:
	print('yes')
	print(1, 1)
else:
	(i, j) = (0, n - 1)
	while l[i] == l1[i]:
		i += 1
	while l[j] == l1[j]:
		j -= 1
	l2 = l[i:j + 1]
	l3 = l[i:j + 1][::-1]
	if sorted(l2) == l3:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


from sys import exit
n = int(input())
a = list(map(int, input().split()))
phase = 0
l = -1
r = -1
for i in range(1, len(a)):
	g = a[i] > a[i - 1]
	if phase == 0 and (not g):
		l = i
		phase = 1
	if phase == 1 and g:
		r = i
		phase = 2
	if phase == 2 and (not g):
		print('no')
		exit()
if phase == 0:
	print('yes')
	print('1 1')
	exit()
elif phase == 1:
	r = len(a)
cur = -1
f = True
for i in range(0, l - 1):
	if a[i] < cur:
		f = False
		break
	cur = a[i]
for i in range(r - 1, l - 2, -1):
	if a[i] < cur:
		f = False
		break
	cur = a[i]
for i in range(r, len(a)):
	if a[i] < cur:
		f = False
		break
	cur = a[i]
if f:
	print('yes')
	print(l, r)
else:
	print('no')


def helper(arr, n):
	start = -1
	end = -1
	flag = 0
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			start = i
			break
	if start == -1:
		return (1, 1)
	for i in range(start + 1, n):
		if arr[i] < arr[i - 1]:
			end = i
	ss = start
	ee = end
	while start <= end:
		(arr[start], arr[end]) = (arr[end], arr[start])
		start += 1
		end -= 1
	for i in range(1, n):
		if arr[i] > arr[i - 1]:
			continue
		else:
			return -1
	return (ss + 1, ee + 1)
n = int(input())
arr = list(map(int, input().split()))
ans = helper(arr, n)
if ans == -1:
	print('no')
else:
	print('yes')
	print(ans[0], end=' ')
	print(ans[1])


__author__ = 'Gleb'
n = int(input())
a = input().split()
isna = []
for i in range(n):
	a[i] = int(a[i])
	isna.append(a[i])
a.sort()
i = 0
while i < n and isna[i] == a[i]:
	i += 1
nach = i
if i == n:
	print('yes')
	print(1, 1)
else:
	nache = isna[i]
	while i < n and (not a[i] == nache):
		i += 1
	kon = i
	b = isna[0:nach]
	for i in range(kon, nach - 1, -1):
		b.append(isna[i])
	b += isna[kon + 1:n]
	if b == a:
		print('yes')
		print(nach + 1, kon + 1)
	else:
		print('no')


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
if a == sorted(a):
	print('yes')
	print(1, 1)
else:
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			start = i
			sub = [a[i]]
			while i < n - 1 and a[i] > a[i + 1]:
				sub.append(a[i + 1])
				i = i + 1
			break
	sub.reverse()
	l = a[:start] + sub + a[start + len(sub):]
	a.sort()
	if l == a:
		print('yes')
		print(start + 1, start + len(sub))
	else:
		print('no')


def sortthearray():
	par1 = int(input())
	par2 = list(map(int, input().split()))
	sortedpar2 = sorted(par2)
	if par2 == sortedpar2:
		return 'yes\n1 1'
	lr = []
	for i in range(par1):
		if par2[i] != sortedpar2[i]:
			lr.append(i)
	rvs = par2[lr[0]:lr[-1] + 1]
	rvs.reverse()
	if rvs == sortedpar2[lr[0]:lr[-1] + 1]:
		return 'yes\n' + str(lr[0] + 1) + ' ' + str(lr[-1] + 1)
	else:
		return 'no'
print(sortthearray())


from math import ceil
(numOFelems, flag) = (int(input()), False)
nonSortdArr = [int(x) for x in input().split()]
for i in range(numOFelems - 1):
	if not flag:
		if nonSortdArr[i + 1] < nonSortdArr[i]:
			start = i
			flag = True
	if flag:
		if nonSortdArr[i + 1] > nonSortdArr[i]:
			end = i
			break
		elif i == numOFelems - 2:
			end = i + 1
			break
if flag:
	for i in range(ceil((end - start) / 2)):
		(nonSortdArr[start + i], nonSortdArr[end - i]) = (nonSortdArr[end - i], nonSortdArr[start + i])
	if sorted(nonSortdArr) == nonSortdArr:
		print('yes')
		print(str(start + 1) + ' ' + str(end + 1))
	else:
		print('no')
else:
	print('yes')
	print('1 1')


n = int(input())
a = [int(j) for j in input().split()]
b = sorted(a)
l = 0
r = n - 1
if a == b:
	print('yes')
	print('1 1')
else:
	while a[l] == b[l]:
		l += 1
	while a[r] == b[r]:
		r -= 1
	if a[l:r + 1] == b[l:r + 1][::-1]:
		print('yes')
		print(1 + min(l, r), 1 + max(l, r))
	else:
		print('no')


n = int(input())
a = [int(x) for x in input().split()]
x = a[:]
y = a[:]
x.sort(reverse=True)
if x == a:
	print('yes')
	print(1, n)
elif a == sorted(a):
	print('yes')
	print(1, 1)
else:
	id = []
	for i in range(1, n - 1):
		if a[i] < a[i - 1] and a[i] < a[i + 1] or (a[i] > a[i - 1] and a[i] > a[i + 1]):
			id += [i]
	if len(id) > 2:
		print('no')
	elif len(id) == 1:
		t = a[:id[0] + 1]
		t.sort()
		t += a[id[0] + 1:]
		y = a[id[0]:]
		y.sort()
		y = a[:id[0]] + y
		if t == sorted(a):
			print('yes')
			print(1, id[0] + 1)
		elif y == sorted(a):
			print('yes')
			print(id[0] + 1, n)
		elif t == x:
			print('yes')
			print(id[0] + 1, n)
		elif y == x:
			print('yes')
			print(1, id[0] + 1)
		else:
			print('no')
	else:
		t = a[id[0]:id[1] + 1]
		t.sort()
		t = a[:id[0]] + t + a[id[1] + 1:]
		if t == sorted(a):
			print('yes')
			print(id[0] + 1, id[1] + 1)
		else:
			print('no')


_ = int(input())
a = [int(k) for k in input().split()]
sort_a = list(sorted(a))
reverse_a = list(reversed(a))
(start, end) = (0, 0)
if a == sort_a:
	print('yes')
	print(1, 1)
elif a == reverse_a:
	print('yes')
	print(1, len(a))
else:
	for i in range(0, len(a)):
		if a[i] != sort_a[i]:
			start = i
			break
	for i in range(len(a) - 1, -1, -1):
		if a[i] != sort_a[i]:
			end = i
			break
	if sort_a[start:end + 1] == list(reversed(a[start:end + 1])):
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


from collections import deque
n = int(input())
arr = list(map(int, input().split()))
if sorted(arr) == arr:
	print('yes')
	print('1 1')
	exit()
else:
	arr2 = sorted(arr)
	indx = deque()
	for i in range(n):
		if arr[i] != arr2[i]:
			indx.append(i)
	(s, e) = (indx[0], indx[-1])
	r1 = deque()
	for i in range(s, e + 1):
		r1.append(arr[i])
	r2 = list(reversed(r1))
	if r2 == sorted(r2):
		print('yes')
		print(s + 1, e + 1)
	else:
		print('no')


import sys
import math
input = sys.stdin.readline
n = int(input().strip())
a = list(map(int, input().strip().split()))
if a == sorted(a):
	print('yes')
	print('1 1')
	exit(0)
a.append(10000000000.0)
a.insert(0, 0)
(start, end) = (-1, -1)
for i in range(1, len(a) - 1):
	if a[i] > a[i + 1] and a[i] > a[i - 1]:
		start = i
		break
for i in range(len(a) - 2, -1, -1):
	if a[i] < a[i + 1] and a[i] < a[i - 1]:
		end = i
		break
a = a[:start] + a[end:start - 1:-1] + a[end + 1:]
if a == sorted(a):
	print('yes')
	print(start, end)
else:
	print('no')


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
A = [int(x) for x in input().split()]
B = list(sorted(A))
l = 0
r = N - 1
while l < N and A[l] == B[l]:
	l += 1
while r >= 0 and A[r] == B[r]:
	r -= 1
if l < r:
	if A[l:r + 1] == list(reversed(B[l:r + 1])):
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


n = int(input())
l = input().split()
temp1 = [int(x) for x in l]
temp2 = [int(x) for x in l]
temp1.sort()
res = []
l = r = 1
for i in range(n):
	if temp1[i] != temp2[i]:
		res.append(i + 1)
if len(res) > 0:
	(l, r) = (min(res), max(res))
if list(reversed(temp1[l - 1:r])) == temp2[l - 1:r]:
	print('yes')
	print(l, r)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))

def main():
	b = sorted(a)
	(l, r) = (0, 0)
	i = 0
	while i < n:
		if a[i] != b[i]:
			l = i
			break
		i += 1
	j = n - 1
	while j >= 0:
		if a[j] != b[j]:
			r = j
			break
		j -= 1
	i = l
	j = r
	while i < j:
		temp = a[i]
		a[i] = a[j]
		a[j] = temp
		i += 1
		j -= 1
	if a[l:r + 1] == b[l:r + 1]:
		print('yes')
		print(str(l + 1) + ' ' + str(r + 1))
	else:
		print('no')
	return
main()


n = int(input())
array = list(map(int, input().split()))
pos = [1]
for i in range(1, n):
	if array[i] >= array[i - 1]:
		pos.append(1)
	else:
		pos.append(-1)
c = 0
for i in range(1, n):
	if pos[i] != pos[i - 1]:
		c += 1
if c > 2:
	print('no')
elif c == 0:
	print('yes')
	print('1 1')
else:
	first = pos.index(-1)
	second = n - pos[::-1].index(-1) - 1
	if sorted(array) == array[:first - 1] + array[first - 1:second + 1][::-1] + array[second + 1:]:
		print('yes')
		print(first, second + 1)
	else:
		print('no')


def solve(n, a):
	start = None
	for i in range(1, n + 1):
		if a[i][1] != i:
			start = i
			break
	if start is None:
		return (1, 1)
	end = a[start][1]
	for i in range(start, end):
		if a[i][1] - a[i + 1][1] != 1:
			return None
	for i in range(end + 1, n):
		if a[i + 1][1] - a[i][1] != 1:
			return None
	return (a[end][1], a[start][1])
n = int(input())
t = [int(x) for x in input().split()]
a = [(0, 0)] * (n + 1)
for i in range(1, n + 1):
	a[i] = (t[i - 1], i)
a.sort()
ans = solve(n, a)
if ans is None:
	print('no')
else:
	print('yes')
	print(ans[0], ans[1])


n = int(input())
l = list(map(int, input().split()))
g = l.copy()
g.sort()
a = -1
b = -1
h = []
for i in range(len(l)):
	if l[i] != g[i]:
		a = i
		break
for i in range(len(l) - 1, -1, -1):
	if l[i] != g[i]:
		b = i
		break
h += l[:a]
h += l[a:b + 1][::-1]
h += l[b + 1:]
if a != -1 and b != -1:
	if h == g:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


n = int(input())
l1 = list(map(int, input().split()))
i = 0
while i < n - 1 and l1[i + 1] > l1[i]:
	i += 1
if i == n - 1:
	print('yes')
	print('1 1')
else:
	L = i
	j = n - 1
	while l1[j - 1] < l1[j] and j != i:
		j -= 1
	R = j
	l1[L:R + 1] = reversed(l1[L:R + 1])
	for i in range(1, n):
		if l1[i] < l1[i - 1]:
			print('no')
			break
	else:
		print('yes')
		print(L + 1, R + 1)


def dkwpwn(lists):
	count = 0
	output = ''
	start = end = None
	lists1 = sorted(lists)
	for i in range(len(lists) - 1):
		if lists[i] > lists[i + 1]:
			start = i
			break
	for i in reversed(range(1, len(lists))):
		if lists[i] < lists[i - 1]:
			end = i
			break
	if start == None or end == None:
		print('yes')
		return '1 1'
	temp = lists[start:end + 1]
	temp = temp[::-1]
	lists[start:end + 1] = temp
	if lists == lists1:
		print('yes')
		return '{} {}'.format(start + 1, end + 1)
	return 'no'
q = int(input())
lists = list(map(int, input().split()))
print(dkwpwn(lists))


n = int(input())
a = [int(i) for i in input().split(' ')]
b = [a[i] for i in range(n)]
b.sort()
x = -1
ans = 'yes\n1 1'
for i in range(n):
	if a[i] != b[i]:
		s = b.index(a[i])
		if i > 0:
			if a[:i] + a[s:i - 1:-1] + a[s + 1:] == b:
				ans = 'yes\n' + str(i + 1) + ' ' + str(s + 1)
			else:
				ans = 'no'
		elif a[:i] + a[s::-1] + a[s + 1:] == b:
			ans = 'yes\n' + str(i + 1) + ' ' + str(s + 1)
		else:
			ans = 'no'
		break
print(ans)


n = int(input())
nr = list(map(int, input().split()))
nr = [0] + nr
changes = []
slope = [0] * (n + 1)
for i in range(1, n + 1):
	if nr[i] > nr[i - 1]:
		slope[i] = 1
	elif nr[i] < nr[i - 1]:
		slope[i] = -1
	else:
		slope[i] = slope[i - 1]
for i in range(1, n + 1):
	if slope[i] * slope[i - 1] == -1:
		changes.append(i - 1)
if len(changes) == 0:
	print('yes')
	print(1, 1)
elif len(changes) == 1:
	if nr[changes[0] - 1] <= nr[n]:
		print('yes')
		print(changes[0], n)
	else:
		print('no')
elif len(changes) == 2:
	if nr[changes[0]] <= nr[changes[1] + 1] and nr[changes[1]] >= nr[changes[0] - 1]:
		print('yes')
		print(changes[0], changes[1])
	else:
		print('no')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
for l in range(n):
	if a[l] != b[l]:
		break
if l == n - 1:
	print('yes')
	print('1 1')
	exit(0)
for r in range(n - 1, 0, -1):
	if a[r] != b[r]:
		break
for i in range(l, r + 1):
	j = r - (i - l)
	if a[i] != b[j]:
		print('no')
		exit(0)
print('yes')
print('%s %s' % (l + 1, r + 1))


n = int(input())
lst = list(map(int, input().split()))
lst2 = sorted(lst)
if lst == lst2:
	print('yes')
	print(1, 1)
else:
	min1 = 10 ** 32
	max1 = 0
	for i in range(n):
		if lst[i] != lst2[i]:
			min1 = min(min1, i)
			max1 = max(max1, i)
	arr1 = lst[:min1]
	arr2 = lst[max1 + 1:]
	res = []
	arr3 = lst[min1:max1 + 1][::-1]
	res.extend(arr1)
	res.extend(arr3)
	res.extend(arr2)
	if res == lst2:
		print('yes')
		print(min1 + 1, max1 + 1)
	else:
		print('no')


n = int(input())
array = list(map(int, input().split()))
new_array = sorted(array)
start = -1
end = -1
flag = False
for i in range(len(array) - 1):
	if array[i] > array[i + 1]:
		start = i
		break
for i in range(len(array) - 1, 0, -1):
	if array[i] < array[i - 1]:
		end = i
		break
s = start
e = end
while s <= e:
	temp = array[s]
	array[s] = array[e]
	array[e] = temp
	s += 1
	e -= 1
for i in range(len(array)):
	if array[i] != new_array[i]:
		flag = True
		break
if flag:
	print('no')
else:
	print('yes')
	if start == end and start == -1:
		print(1, 1)
	else:
		print(start + 1, end + 1)


n = int(input())
a = list(map(int, input().split()))
(b, e) = (0, 0)
sorted_a = sorted(a)
if sorted_a == a:
	print('yes')
	print(b + 1, e + 1)
	exit()
for i in range(n - 1):
	if a[i] > a[i + 1]:
		b = i
		while i < n - 1 and a[i] > a[i + 1]:
			i += 1
		e = i
		break
if sorted_a == a[:b] + a[b:e + 1][::-1] + a[e + 1:]:
	print('yes')
	print(b + 1, e + 1)
else:
	print('no')


n = int(input())
t = list(map(int, input().split()))
a = -99
b = -99
if t == sorted(t):
	print('yes')
	print(1, 1)
elif t == sorted(t)[::-1]:
	print('yes')
	print(1, n)
else:
	for j in range(n - 1):
		if t[j + 1] < t[j] and a == -99:
			a = j
		if a != -99 and t[j + 1] > t[j]:
			b = j
			break
	if b == -99 and t[-1] < t[-2]:
		b = n - 1
	u = t[:a] + t[a:b + 1][::-1] + t[b + 1:]
	if u == sorted(u):
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = LI()
	t = sorted(a)
	if a == t:
		return 'yes\n1 1'
	mi = ma = 0
	for i in range(n):
		if a[i] != t[i]:
			mi = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] != t[i]:
			ma = i + 1
			break
	u = a[:mi] + a[mi:ma][::-1] + a[ma:]
	if t == u:
		return 'yes\n{} {}'.format(mi + 1, ma)
	return 'no'
print(main())


from collections import *
from bisect import *
from math import *
from heapq import *
from fractions import *
import sys
input = sys.stdin.readline
t = 1

def r(a):
	return a * (a - 1) // 2
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a1 = a[:]
	a1.sort()
	if a1 == a:
		print('yes')
		print(1, 1)
		exit(0)
	a.append(float('inf'))
	sp = -1
	ep = 0
	for i in range(n):
		if a[i] > a[i + 1] and sp < 0:
			sp = i
		elif a[i] > a[i + 1] and sp >= 0:
			ep = i
		else:
			ep = i
			if sp >= 0:
				break
	b = a[sp:ep + 1]
	b.sort()
	a = a[:sp] + b + a[ep + 1:-1]
	if a1 != a:
		print('no')
	else:
		print('yes')
		print(sp + 1, ep + 1)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
left = -1
right = -1
for i in range(n):
	if a[i] != b[i] and left == -1:
		left = i
	if a[i] != b[i]:
		right = i
if left == -1 and right == -1:
	left = 0
	right = 0
u = left
v = right
while u < v:
	(a[v], a[u]) = (a[u], a[v])
	u += 1
	v -= 1
for i in range(n):
	if a[i] != b[i]:
		print('no')
		exit()
print('yes')
print(left + 1, right + 1)


n = int(input())
m = list(map(int, input().split()))
a = list(m)
a.sort()
if a == m:
	print('yes')
	print(1, 1)
	exit()
start = 0
end = n - 1
b = True
c = True
for i in range(n):
	if m[0] != a[0] and b:
		start = i
		b = False
	elif m[0] == a[0] and b:
		del m[0]
		del a[0]
	if m[-1] != a[-1] and c:
		end = n - 1 - i
		c = False
	elif m[-1] == a[-1] and c:
		del m[-1]
		del a[-1]
for i in range(end - start):
	if a[i] != m[end - start - i]:
		print('no')
		exit()
print('yes')
print(start + 1, end + 1)


from sys import stdin
n = int(stdin.readline().strip())
arr = [int(x) for x in stdin.readline().strip().split()]
i = 1
flag = 0
ans = True
while i < n and ans:
	if arr[i] < arr[i - 1] and flag == 0:
		flag = 1
		a = i
		barrier = arr[i - 1]
		if i - 2 == -1:
			barrier2 = -float('inf')
		else:
			barrier2 = arr[i - 2]
	if arr[i] > arr[i - 1] and flag == 1:
		if arr[i] < barrier or arr[i - 1] < barrier2:
			ans = False
		flag = 2
		b = i
	if arr[i] < arr[i - 1] and flag == 2:
		ans = False
	i += 1
if flag == 1 and a > 1 and (arr[a - 2] > arr[-1]):
	ans = False
if not ans or flag == 3:
	print('no')
else:
	print('yes')
	if flag == 0:
		print('1 1')
	elif flag == 1:
		print(a, i)
	else:
		print(a, b)


n = int(input())
l = list(map(int, input().split()))
s = sorted(l)
i = 0
left = r = 0
if l == s:
	print('yes')
	print(left + 1, end=' ')
	print(r + 1)
	exit()
while l[i] == s[i] and i < n - 1:
	i += 1
left = i
while i < n:
	if s[i] != l[i]:
		r = i
	i += 1
l[left:r + 1] = l[left:r + 1][::-1]
if l == s:
	print('yes')
	print(left + 1, end=' ')
	print(r + 1)
else:
	print('no')


n = int(input())
entr = input().split(' ')
a = []
k = []
res = []
res2 = []
parar = True
for i in range(n):
	a.append(int(entr[i]))
	k.append(a[i])
for i in range(n):
	if i < n - 1 and a[i + 1] < a[i] and parar:
		res.append(a[i])
		res2.append(i)
	elif i == n - 1 and a[i - 1] > a[i] and parar:
		res.append(a[i])
		res2.append(i)
	elif i != 0 and a[i - 1] > a[i] and parar:
		res.append(a[i])
		res2.append(i)
		parar = False
k = sorted(k)
res = sorted(res, reverse=True)
res2 = sorted(res2, reverse=True)
for i in range(len(res)):
	x = int(res2[i])
	a[x] = res[i]
t = False
for i in range(n):
	if a[i] != k[i]:
		t = True
		break
if t:
	print('no')
elif len(res) == 0:
	print('yes')
	print(1, 1)
else:
	print('yes')
	print(res2[len(res2) - 1] + 1, res2[0] + 1)


def bs(a, key, i):
	j = len(a)
	while i <= j:
		mid = (i + j) // 2
		if a[mid] == key:
			return mid
		elif a[mid] > key:
			j = mid - 1
		else:
			i = mid + 1
	return -1
n = int(input())
l = list(map(int, input().split()))
a = sorted(l)
for i in range(len(l)):
	if l[i] != a[i]:
		break
if i < n:
	ind = bs(a, l[i], i)
if ind == -1:
	print('no')
elif i == n - 1:
	print('yes')
	print(1, 1)
else:
	f = 0
	j = 0
	for k in range(i, ind + 1):
		if l[k] != a[ind - j]:
			f = 1
			break
		j += 1
	if f == 1:
		print('no')
	else:
		for k in range(ind + 1, n):
			if l[k] != a[k]:
				f = 1
				break
		if f == 1:
			print('no')
		else:
			print('yes')
			print(i + 1, ind + 1)


n = int(input())
a = list(map(int, input().split()))
l = 0
r = 0
f = 0
ma = 0
mi = 0
for i in range(n - 1):
	if f == 0:
		if a[i] > a[i + 1]:
			f = 1
			l = i + 1
			ma = a[i]
			if i == 0:
				mi = -1
			else:
				mi = a[i - 1]
	elif f == 1:
		if a[i] < a[i + 1]:
			f = 2
			r = i + 1
			if ma > a[i + 1] or a[i] < mi:
				print('no')
				break
	elif a[i] > a[i + 1]:
		print('no')
		break
else:
	if f == 2:
		print('yes')
		print(l, r)
	elif f == 1:
		if a[-1] < mi:
			print('no')
		else:
			print('yes')
			print(l, n)
	else:
		print('yes')
		print(1, 1)


n = int(input())
a = list(map(int, input().split()))
if a == sorted(a):
	print('yes')
	print('1 1')
else:
	decreasing = False
	count = 0
	ii = 0
	jj = -1
	for i in range(1, n):
		if decreasing:
			if a[i] > a[i - 1]:
				decreasing = False
				jj = i
		elif a[i] < a[i - 1]:
			decreasing = True
			count += 1
			ii = i
	if count == 1:
		if jj == -1:
			if ii == 1:
				print('yes')
				print(1, n)
			elif a[n - 1] > a[ii - 2]:
				print('yes')
				print(ii, n)
			else:
				print('no')
		elif a[ii - 1] < a[jj]:
			print('yes')
			print(ii, jj)
		else:
			print('no')
	else:
		print('no')


n = int(input())
array = list(map(int, input().split()))
sorted_array = sorted(array)
if array == sorted_array:
	print('yes')
	print(1, 1)
	exit()
(start, end) = (-1, -1)
for i in range(n):
	if array[i] != sorted_array[i]:
		if start == -1:
			start = i
		else:
			end = i
array[start:end + 1] = reversed(array[start:end + 1])
if sorted_array == array:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
if len(l) == 1 or l == sorted(l):
	print('yes')
	print(1, 1)
elif l == sorted(l, reverse=True):
	print('yes')
	print(1, n)
else:
	c1 = 0
	c2 = 0
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] >= l[i + 1]:
			pos1 = i
			c1 = c1 + 1
		elif l[i] <= l[i - 1] and l[i] < l[i + 1]:
			pos2 = i
			c2 = c2 + 1
	if c1 == 1 and c2 == 1 and (l[pos1 - 1] <= l[pos2]) and (l[pos2 + 1] >= l[pos1]) and (pos2 > pos1):
		print('yes')
		print(pos1 + 1, pos2 + 1)
	elif c1 == 1 and c2 == 0 and (l[n - 1] >= l[pos1 - 1]):
		print('yes')
		print(pos1 + 1, n)
	elif c1 == 0 and c2 == 1 and (l[0] <= l[pos2 + 1]):
		print('yes')
		print(1, pos2 + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
m = a.copy()
m.sort()
if a == m:
	print('yes')
	print('1 1')
	quit()
i = 0
j = n - 1
if n == 2:
	m = a.copy()
	a.sort()
	print('yes')
	if m == a:
		print('1 1')
	else:
		print('1 2')
	quit()
while a[i] < a[i + 1]:
	i += 1
while a[j] > a[j - 1]:
	j -= 1
if j < i:
	temp = i
	i = j
	j = temp
m = a[i:j + 1]
m.reverse()
m = a[:i] + m + a[j + 1:]
a.sort()
if a == m:
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


n = int(input())
brr = list(map(int, input().split()))
arr = sorted(brr)
y = []
x = []
a = 0
b = n - 1
if arr == brr:
	print('yes')
	print(a + 1, a + 1)
	exit()
z = [ele for ele in reversed(brr)]
if arr == z:
	print('yes')
	print(a + 1, b + 1)
	exit()
while True:
	if arr[a] != brr[a]:
		break
	else:
		a += 1
while True:
	if arr[b] != brr[b]:
		break
	else:
		b -= 1
for i in range(a, b + 1):
	x.append(brr[i])
	y.append(arr[i])
x.reverse()
if x == y:
	print('yes')
	print(a + 1, b + 1)
else:
	print('no')


n = int(input())
a = [int(x) for x in input().split()]
b = a[:]
b.sort()
judge = [0] * n
start = 0
end = 0
for i in range(1, n):
	if a[i] > a[i - 1]:
		judge[i] = True
	else:
		judge[i] = False
for i in range(1, n):
	if judge[i] == False:
		start = i
		break
for i in range(n - 1, 0, -1):
	if judge[i] == False:
		end = i
		break
c = a[start - 1:end + 1]
c.reverse()
if start == 0 and end == 0:
	print('yes')
	print(1, 1)
elif start - 2 >= 0 and end + 1 <= n - 1:
	if a[:start - 1] + c + a[end + 1:] == b:
		print('yes')
		print(start, end + 1)
	else:
		print('no')
elif start - 2 < 0 and end + 1 <= n - 1:
	if c + a[end + 1:] == b:
		print('yes')
		print(start, end + 1)
	else:
		print('no')
elif start - 2 >= 0 and end + 1 > n - 1:
	if a[:start - 1] + c == b:
		print('yes')
		print(start, end + 1)
	else:
		print('no')
elif start - 2 < 0 and end + 1 > n - 1:
	if c == b:
		print('yes')
		print(start, end + 1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
tempt = sorted(arr)
l = 0
r = 0
flag = 0
for i in range(n):
	if flag == 0 and tempt[i] != arr[i]:
		flag = 1
		l = i
	elif flag == 1 and tempt[i] != arr[i]:
		r = i
arr[l:r + 1] = arr[l:r + 1][::-1]
if arr == tempt:
	print('yes')
	print(str(l + 1) + ' ' + str(r + 1))
else:
	print('no')


import sys
z = int(input())
x = list(map(int, input().split()))
c = sorted(x)
for i in range(z):
	if x[i] != c[i]:
		a = i
		break
for j in range(z - 1, -1, -1):
	if x[j] != c[j]:
		b = j
		break
if x == c:
	print('yes')
	print(1, 1)
	sys.exit(0)
v = reversed(x[a:b + 1])
x[a:b + 1] = v
if x == c:
	print('yes')
	print(a + 1, b + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i = 1
l = 0
r = n - 1
if a == b:
	print('yes')
	print('1 1')
else:
	while i < n:
		if a[i - 1] > a[i]:
			l = i - 1
			break
		i += 1
	i += 1
	while i < n:
		if a[i - 1] < a[i]:
			r = i - 1
			break
		i += 1
	a = a[:l] + sorted(a[l:r + 1]) + a[r + 1:]
	if a == b:
		print('yes')
		t = str(l + 1) + ' ' + str(r + 1)
		print(t)
	else:
		print('no')


import sys
n = eval(input())
Array = list(map(int, input().split()))
Sort_Array = sorted(Array, reverse=False)
if Sort_Array == Array:
	print('yes')
	print(1, 1)
	sys.exit(0)
count = 0
for i in range(n):
	if Array[i] != Sort_Array[i]:
		count = i
		break
count2 = 0
for j in range(count + 1, n):
	if Array[j] == Sort_Array[count]:
		Array[count:j + 1] = reversed(Array[count:j + 1])
		count2 = j + 1
		break
if Array == Sort_Array:
	print('yes')
	print(count + 1, count2)
else:
	print('no')


n = int(input())
l = [int(i) for i in input().split()]
d = set()
i = 0
while i < len(l) - 1:
	if l[i] > l[i + 1]:
		if len(d) == 1:
			d.add(5)
			break
		start = i
		while i < len(l) - 1 and l[i] > l[i + 1]:
			i += 1
		end = i
		t = (start + 1, end + 1)
		d.add(t)
	else:
		i += 1
if len(d) > 1:
	print('no')
elif len(d) == 0:
	print('yes')
	print(1, 1)
else:
	l[start:end + 1] = list(reversed(l[start:end + 1]))
	if l != sorted(l):
		print('no')
	else:
		print('yes')
		for i in d:
			print(*i)


n = int(input())
L = list(map(int, input().split()))
L1 = sorted(L)
j = 0
k = n - 1
if L == L1:
	print('yes')
	print('1 1')
else:
	while L[j] == L1[j]:
		j += 1
	while L[k] == L1[k]:
		k -= 1
	if L[j:k + 1] == L1[j:k + 1][::-1]:
		print('yes')
		print(j + 1, k + 1)
	else:
		print('no')


a = int(input())
b = list(map(int, input().split()))
c = sorted(b)
for i in range(a):
	if b[i] != c[i]:
		if b[i:b.index(c[i]) + 1][::-1] == c[i:c.index(b[i]) + 1]:
			if b[b.index(c[i]) + 1:] == c[c.index(b[i]) + 1:]:
				print('yes')
				print(i + 1, b.index(c[i]) + 1)
				exit()
		exit(print('no'))
print('yes\n1 1')


n = int(input())
a = list(map(int, input().split()))
i = 0
if a == sorted(a):
	print('yes')
	print(1, 1)
	exit(0)
while i < n and a[i + 1] > a[i]:
	i += 1
j = n - 1
while j > 0 and a[j] > a[j - 1]:
	j -= 1
newArray = [None] * n
x = j
m = i
while x >= i:
	newArray[m] = a[x]
	m += 1
	x -= 1
for x1 in range(0, i):
	newArray[x1] = a[x1]
for x1 in range(j + 1, n):
	newArray[x1] = a[x1]
flag = 0
if newArray == sorted(newArray):
	flag = 1
if flag:
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


import sys
import math
import bisect

def solve(A):
	n = len(A)
	B = A.copy()
	B.sort()
	l = -1
	r = -1
	for i in range(n):
		if A[i] != B[i]:
			if l == -1:
				l = i
			r = i
	if l == -1:
		return [0, 0]
	B = B[0:l] + B[l:r + 1][::-1] + B[r + 1:n]
	if A == B:
		return [l, r]
	else:
		return None

def main():
	n = int(input())
	A = list(map(int, input().split()))
	ans = solve(A)
	if ans == None:
		print('no')
	else:
		print('yes')
		print('%d %d' % (ans[0] + 1, ans[1] + 1))
main()


from collections import defaultdict
import sys, io, os
INP = sys.stdin.readline
inp = lambda : [*map(int, INP().encode().split())]
sinp = lambda : [*map(str, INP().split())]
out = sys.stdout.write

def main():
	n = inp()[0]
	l = inp()
	c = 0
	check = 1
	if l == sorted(l):
		print('yes')
		print(1, 1)
		return
	for i in range(1, n):
		if l[i] - l[i - 1] > 0 and c == 0:
			continue
		elif l[i] - l[i - 1] < 0:
			c += 1
		elif l[i] - l[i - 1] > 0 and c != 0:
			check = 0
			break
	if check:
		i += 1
	l[i - 1 - c:i] = l[-len(l) - 1 + i:-len(l) - 1 + i - 1 - c:-1]
	if l == sorted(l):
		print('yes')
		print(i - c, i)
	else:
		print('no')

def SumOfExpOfFactors(a):
	fac = 0
	lis = SortedList()
	if not a & 1:
		lis.add(2)
	while not a & 1:
		a >>= 1
		fac += 1
	for i in range(3, int(a ** 0.5) + 1, 2):
		if not a % i:
			lis.add(i)
		while not a % i:
			a //= i
			fac += 1
	if a != 1:
		lis.add(a)
		fac += 1
	return (fac, lis)
div = [0] * 1000001

def NumOfDivisors(n):
	for i in range(1, n + 1):
		for j in range(i, n + 1, i):
			div[j] += 1

def primes1(n):
	sieve = [True] * (n // 2)
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i // 2]:
			sieve[i * i // 2::i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [2 * i + 1 for i in range(1, n // 2) if sieve[i]]

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)

class Graph:

	def __init__(self):
		self.Graph = defaultdict(list)

	def addEdge(self, u, v):
		self.Graph[u].append(v)
		self.Graph[v].append(u)

	def DFSUtil(self, v, visited):
		visited.add(v)
		for neighbour in self.Graph[v]:
			if neighbour not in visited:
				self.DFSUtil(neighbour, visited)

	def DFS(self, v):
		visited = set()
		self.DFSUtil(v, visited)

	def BFS(self, s):
		visited = set()
		queue = []
		queue.append(s)
		visited.add(s)
		while queue:
			s = queue.pop(0)
			for i in self.Graph[s]:
				if i not in visited:
					queue.append(i)
					visited.add(i)

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
main()


n = int(input())
a = list(map(int, input().split()))
d = {}
b = list(a)
b.sort()
for (idx, val) in enumerate(b):
	d[val] = idx
for i in range(n):
	a[i] = d[a[i]]
L = 0
R = n - 1
while L < n and a[L] == L:
	L += 1
while R > 0 and a[R] == R:
	R -= 1
if L == n or R == 0:
	print('yes')
	print('{} {}'.format(1, 1))
	exit()
a[L:R + 1] = reversed(a[L:R + 1])
for i in range(0, n - 1):
	if a[i] >= a[i + 1]:
		print('no')
		exit()
print('yes')
print('{} {}'.format(L + 1, R + 1))


def solve(arr):
	n = len(arr)
	l = n
	r = -1
	for i in range(0, n - 1):
		if arr[i] > arr[i + 1]:
			l = min(l, i)
			r = max(r, i + 1)
	if r < l:
		return (1, 1)
	t = arr[:l] + list(reversed(arr[l:r + 1])) + arr[r + 1:]
	if t != sorted(arr):
		return None
	return (l + 1, r + 1)

def solve2(arr):
	n = len(arr)
	seq = set()
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			seq.add(i)
			seq.add(i + 1)
	l = sorted(list(seq))
	if len(l) == 0:
		return (1, 1)
	t = arr[:l[0]] + list(reversed(arr[l[0]:l[-1] + 1])) + arr[l[-1] + 1:]
	if t != sorted(arr):
		return None
	return (l[0] + 1, l[-1] + 1)

def test():
	p = lambda st: list(map(int, st.split()))
	assert solve(p('3 2 1')) == (1, 3)
	assert solve(p('2 1 3 4')) == (1, 2)
	assert solve(p('3 1 2 4')) == None
	assert solve(p('1 2')) == (1, 1)
	assert solve(p('1 5 3 4 2 6')) == None
	assert solve(p('19517752 43452931 112792556 68417469 779722934 921694415')) == (3, 4)
test()
input()
res = solve(list(map(int, input().split())))
if res is None:
	print('no')
else:
	print('yes\n{} {}'.format(res[0], res[1]))


n = int(input())
a = list(map(int, input().split()))
k = list(a)
k.sort()
(t, p, m) = (1, 1, 1)
(l, r) = (0, 0)
for i in range(n):
	if t:
		if a[i] != k[i]:
			l = i
			r = a.index(k[i])
			t = 0
	elif i <= r:
		if a[r - m] != k[i]:
			p = 0
			break
		m += 1
	elif i > r and k[i] != a[i]:
		p = 0
		break
if p:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
lst = list(map(int, input().split()))
right = -1
left = -1
clone_lst = list(lst)
clone_lst.sort()
for (i, (x, y)) in enumerate(zip(lst, clone_lst)):
	if x != y and left == -1:
		left = i
	if x != y:
		right = i
if left == -1 and right == -1:
	(left, right) = (0, 0)
u = left
v = right
while u < v:
	(lst[u], lst[v]) = (lst[v], lst[u])
	v = v - 1
	u = u + 1
if lst == clone_lst:
	print('yes')
	print(str(left + 1), str(right + 1))
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
cnt = 0
ans = 0
fi = 1
si = 1
for i in range(len(l) - 1):
	if l[i] > l[i + 1]:
		if cnt == 0:
			fi = i + 1
			si = i + 2
			ans = ans + 1
			if ans > 1:
				print('no')
				exit(0)
		else:
			si = i + 2
		cnt = cnt + 1
	elif l[i] < l[i + 1]:
		cnt = 0
	else:
		cnt = 0
if ans > 1:
	print('no')
	exit(0)
j = si - 1
i = fi - 1
while i < j:
	temp = l[i]
	l[i] = l[j]
	l[j] = temp
	j = j - 1
	i = i + 1
l2 = l.copy()
l2.sort()
if l == l2:
	print('yes')
	print(fi, si)
else:
	print('no')


z = int(input())
x = list(map(int, input().split()))
b = sorted(x)
c = 0
v = z - 1
if x == b:
	print('yes')
	print(1, 1)
else:
	while x[c] == b[c]:
		c = c + 1
	while x[v] == b[v]:
		v = v - 1
	if b[c:v + 1] == x[c:v + 1][::-1]:
		print('yes')
		print(c + 1, v + 1)
	else:
		print('no')


n = int(input())
xs = [0] + list(map(int, input().split())) + [10 ** 10]
prev = 0
phase = 1
(first_i, last_i) = (1, 1)
for (i, x) in enumerate(xs[1:], start=1):
	if phase == 1:
		if x < prev:
			phase = 2
			first_i = i - 1
	elif phase == 2:
		if x > prev:
			phase = 3
			last_i = i - 1
			if xs[first_i] < xs[i] and xs[last_i] > xs[first_i - 1]:
				pass
			elif xs[first_i + 1] < xs[i] and xs[last_i] > xs[first_i] and (last_i - first_i >= 2):
				first_i += 1
			else:
				print('no')
				break
	elif phase == 3:
		if x < prev:
			print('no')
			break
	prev = x
else:
	print('yes')
	print(first_i, last_i)


n = int(input())
inp = list(map(int, input().split()))
sinp = inp[:]
sinp.sort()
if inp == sinp:
	print('yes')
	print('1 1')
else:
	for (i, j) in zip(inp, sinp):
		if i != j:
			ans = inp.index(i)
			break
	for i in range(n - 1, -1, -1):
		if inp[i] != sinp[i]:
			ansi = i
			break
	rev = inp[ans:ansi + 1]
	rev.reverse()
	if rev == sinp[ans:ansi + 1]:
		print('yes')
		print(ans + 1, ansi + 1)
	else:
		print('no')


def sortarray(n, a):
	s_d = None
	e_d = None
	decreasing = False
	count = 0
	for i in range(1, n):
		if a[i] - a[i - 1] < 0:
			if decreasing:
				e_d = i
			elif count < 1:
				decreasing = True
				s_d = i - 1
				e_d = i
				count = 1
			else:
				print('no')
				return
		elif decreasing:
			break
	if s_d != None and e_d != None:
		if s_d == 0:
			ans = a[:e_d + 1]
			ans = ans[::-1]
			ans.extend(a[e_d + 1:])
		else:
			ans = a[:s_d]
			alpha = a[s_d:e_d + 1]
			ans.extend(alpha[::-1])
			ans.extend(a[e_d + 1:])
		if sorted(ans) == ans:
			print('yes')
			print(s_d + 1, e_d + 1)
			return
		else:
			print('no')
	else:
		print('yes')
		print(1, 1)
t = int(input())
a = list(map(int, input().split(' ')))
sortarray(t, a)


def main():
	n = int(input())
	lst = [int(i) for i in input().split()]
	sorted_lst = sorted(lst)
	left = 0
	right = 0
	for i in range(n):
		if lst[i] != sorted_lst[i]:
			left = i
			for j in range(i, n):
				if lst[j] != sorted_lst[j]:
					right = j
			break
	rev_seg = sorted_lst[left:right + 1]
	rev_seg.reverse()
	if lst[left:right + 1] == rev_seg:
		print('yes')
		print('%d %d' % (left + 1, right + 1))
	else:
		print('no')
main()


n = int(input())
ls = list(map(int, input().split()))
ls1 = ls[:]
ls.sort()
i = 0
j = len(ls) - 1
ls3 = []
if ls1 == ls:
	print('yes')
	print('1 1')
else:
	while i < j:
		if ls1[i] == ls[i]:
			i = i + 1
		if ls1[j] == ls[j]:
			j = j - 1
		if ls1[i] != ls[i] and ls1[j] != ls[j]:
			ls2 = ls1[i:j + 1]
			break
	ls2 = ls2[::-1]
	if i > 0:
		ls3 = ls1[:i]
	ls3 = ls3 + ls2[:]
	if j < len(ls) - 1:
		ls3 = ls3 + ls1[j + 1:]
	if ls3 == ls:
		print('yes')
		print(str(i + 1) + ' ' + str(j + 1))
	else:
		print('no')


n = int(input())
L = [int(i) for i in input().split()]
(start, end) = (0, 0)
M = []
for i in range(n - 1):
	if L[i] > L[i + 1]:
		start = i
		break
for i in range(n - 1, 0, -1):
	if L[i] < L[i - 1]:
		end = i
		break
for i in range(start):
	M.append(L[i])
for i in range(end, start - 1, -1):
	M.append(L[i])
for i in range(end + 1, len(L)):
	M.append(L[i])
if M == sorted(L):
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
x1 = 0
for i in range(n - 1):
	if l[i] < l[i + 1]:
		continue
	else:
		x1 = i
		break
t = []
for i in l:
	t.append(i)
t.sort()
if l == t:
	print('yes')
	print('1 1')
	quit()
c = x1
x2 = 0
m = []
for i in range(x1, n):
	if i == n - 1:
		m.append(l[i])
		x2 = n - 1
		break
	elif l[i] < l[i + 1]:
		x2 = i
		m.append(l[i])
		break
	else:
		m.append(l[i])
		continue
m.reverse()
for i in range(x1, x2 + 1):
	l[i] = m[i - x1]
if l == t:
	print('yes')
	print(x1 + 1, x2 + 1)
else:
	print('no')


def main():
	n = int(input())
	nums = list(map(int, input().split()))
	o = sorted(nums)
	(p, q) = (-1, -1)
	for i in range(n):
		if nums[i] != o[i]:
			if p == -1:
				p = q = i
			else:
				q = i
	if p == q and q == -1:
		print('yes')
		print(1, 1)
	elif nums[p:q + 1] == o[p:q + 1][::-1]:
		print('yes')
		print(p + 1, q + 1)
	else:
		print('no')
main()


n = int(input())
arr = list(map(int, input().split()))
arr2 = arr.copy()
arr2.sort()
box = []
for i in range(len(arr)):
	if arr[i] != arr2[i]:
		box.append(i)
if len(box) == 0:
	box.append(0)
l = box[0]
r = box[-1]
arr[l:r + 1] = arr[l:r + 1][::-1]
if arr == arr2:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
w = input().split(' ')
arr = []
for i in range(n):
	arr.append(int(w[i]))
sarr = []
for i in range(n):
	sarr.append(arr[i])
sarr.sort()
index = []
part = []
for i in range(n):
	if arr[i] != sarr[i]:
		index.append(i)
if len(index) != 0:
	for i in range(index[0], index[len(index) - 1] + 1):
		part.append(arr[i])
part.reverse()
if len(index) == 0:
	print('yes')
	print('1 1')
elif arr[0:index[0]] + part + arr[index[len(index) - 1] + 1:n] == sarr:
	print('yes')
	print(str(index[0] + 1) + ' ' + str(index[len(index) - 1] + 1))
else:
	print('no')


n = int(input())
a = [int(x) for x in input().split()]
b = sorted(a)
(l, r) = (0, n - 1)
if a == b:
	print('yes')
	print(1, 1)
else:
	while a[l] == b[l]:
		l += 1
	while a[r] == b[r]:
		r -= 1
	if a[l:r + 1] == b[l:r + 1][::-1]:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
a_sorted = sorted(a)
if a == a_sorted:
	print('yes')
	print(1, 1)
else:
	(r, l, i) = (-1, -1, 1)
	for i in range(1, n):
		if i == n - 1:
			l = n
		if a[i] < a[i - 1] and r == -1:
			r = i
		if r != -1:
			if a[r] < a[i]:
				l = i
		if l != -1:
			break
	w = a[:r - 1]
	e = a[r - 1:l]
	w.extend(e[::-1])
	w.extend(a[l:])
	if w == a_sorted:
		print('yes')
		print(r, l)
	else:
		print('no')


n = int(input())
arr = [int(x) for x in input().split()]
m = 0
start = 0
end = 0
for i in range(0, n - 1):
	if arr[i + 1] < arr[i]:
		if m == 0:
			start = i
			m = 1
		if i + 1 == n - 1:
			end = n - 1
	elif arr[i + 1] > arr[i]:
		if m == 1:
			end = i
			break
part = arr[start:end + 1]
part = part[::-1]
new_arr = arr[:start] + part + arr[end + 1:]
if (start == 0) & (end == 0):
	start = 1
	end = 1
else:
	start = start + 1
	end = end + 1
if new_arr == sorted(arr):
	print('yes')
	print(start, end)
else:
	print('no')


import sys
input = sys.stdin.readline

def gint():
	return int(input())

def gint_arr():
	return list(map(int, input().split()))

def gfloat():
	return float(input())

def gfloat_arr():
	return list(map(float, input().split()))

def pair_int():
	return map(int, input().split())
INF = 1 << 31
MOD = '1000000007'
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
n = gint()
a = gint_arr()
(left, right) = (0, n - 1)
while left < n - 1 and a[left] < a[left + 1]:
	left += 1
while right > 0 and a[right] > a[right - 1]:
	right -= 1
if not right:
	print('yes\n1 1')
else:
	i = left
	j = right
	while i < j and a[i] > a[i + 1]:
		i += 1
	correct = False
	if i == j:
		a = a[:left] + list(reversed(a[left:right + 1])) + a[right + 1:]
		i = 0
		while i < n - 1 and a[i] < a[i + 1]:
			i += 1
		correct = i == n - 1
	if correct:
		print(f'yes\n{left + 1} {right + 1}')
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
rs = 0
re = 0
for i in range(n - 1):
	if a[i] > a[i + 1]:
		if rs == 0:
			rs = i + 1
		elif re != 0:
			rs = -1
			break
	elif rs != 0 and re == 0:
		if i + 1 < n and a[rs - 1] > a[i + 1] or (rs - 2 >= 0 and a[i] < a[rs - 2]):
			rs = -1
			break
		else:
			re = i + 1
if re == 0 and rs != 0:
	if rs - 2 >= 0 and a[n - 1] < a[rs - 2]:
		rs = -1
	re = n
elif re == 0 and rs == 0:
	(re, rs) = (1, 1)
if rs != -1:
	print('yes')
	print(rs, re)
else:
	print('no')


n = int(input())
b = list(map(int, input().split()))
a = sorted(b)
if a == b:
	print('yes')
	print('1', '1')
	exit()
for i in range(len(b)):
	if b[i] != a[i]:
		f = i
		break
for i in reversed(range(len(b))):
	if b[i] != a[i]:
		e = i
		break
b[f:e + 1] = reversed(b[f:e + 1])
if b == a:
	print('yes')
	print(f + 1, e + 1)
else:
	print('no')


n = int(input())
x = [0]
x += list(map(int, input().split()))
x.append(10 ** 10)
start = end = None
for i in range(1, len(x)):
	if x[i] < x[i - 1]:
		if not start:
			start = i - 1
		if end:
			print('no')
			exit()
	elif start and (not end):
		end = i - 1
if not start and (not end):
	print('yes')
	print(1, 1)
	exit()
x = x[:start] + x[start:end + 1][::-1] + x[end + 1:]
for i in range(1, len(x)):
	if x[i] < x[i - 1]:
		print('no')
		exit()
print('yes')
print(start, end)


n = int(input())
arr = [int(x) for x in input().split()]
sortedarr = sorted(arr)
(left, right) = (0, n - 1)
if arr == sortedarr:
	print('yes')
	print('1 1')
elif arr == arr[::-1]:
	print('yes')
	print(1, n)
else:
	while arr[left] == sortedarr[left]:
		left += 1
	while arr[right] == sortedarr[right]:
		right -= 1
	if arr[left:right + 1] == sortedarr[left:right + 1][::-1]:
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')


def findindex(L, n1, n2):
	a = 0
	b = 0
	for i in range(len(L)):
		if L[i] == n1:
			a = i + 1
		if L[i] == n2:
			b = i + 1
	return [a, b]
n = int(input())
L = list(map(int, input().split()))
M = []
start = L[0]
end = 0
for i in range(1, n - 1):
	if L[i] < L[i - 1] and L[i] < L[i + 1]:
		end = L[i]
		M.append([start, end])
		start = L[i + 1]
	elif L[i] > L[i - 1] and L[i] > L[i + 1]:
		end = L[i - 1]
		M.append([start, end])
		start = L[i]
end = L[n - 1]
M.append([start, end])
if len(M) > 3:
	print('no')
elif len(M) == 1:
	if M[0][0] >= M[0][1]:
		print('yes')
		print(1, n)
	else:
		print('yes')
		print('1 1')
elif len(M) == 2:
	max1 = max(M[0])
	min2 = min(M[1])
	if min2 > max1:
		print('yes')
		if M[0][0] > M[0][1]:
			ans = findindex(L, max(M[0]), min(M[0]))
			print(ans[0], ans[1])
		else:
			ans = findindex(L, max(M[1]), min(M[1]))
			print(ans[0], ans[1])
	else:
		print('no')
else:
	max1 = max(M[0])
	max2 = max(M[1])
	min2 = min(M[1])
	min3 = min(M[2])
	if min2 > max1 and min3 > max2:
		print('yes')
		ans = findindex(L, max(M[1]), min(M[1]))
		print(ans[0], ans[1])
	else:
		print('no')


n = int(input())
array = [i for i in map(int, input().split())]
new_array = sorted(array)
if array == new_array:
	print('yes')
	print(1, 1)
else:
	i = 0
	j = n - 1
	while i < n:
		if array[i] != new_array[i]:
			left = i
			break
		else:
			i += 1
	while j > 0:
		if array[j] != new_array[j]:
			right = j
			break
		else:
			j -= 1
	if list(reversed(array[left:right + 1])) == new_array[left:right + 1]:
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')


import sys
import math

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))

def p(a):
	print(a)
n = iinp()
a = linp()
b = a.copy()
b.sort()
flag = 0
start = end = 0
for i in range(len(a) - 1):
	if a[i] > a[i + 1] and flag == 0:
		start = i
		end = i + 1
		flag = 1
	elif a[i] > a[i + 1] and flag == 1:
		end = i + 1
	elif a[i] <= a[i + 1] and flag == 1:
		break
a[start:end + 1] = sorted(a[start:end + 1])
if a == b:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
kl = list(map(int, input().split()))
a = []

def ppedy(r, t):
	w = kl[:r - 1]
	for i in range(t - r + 1):
		w.append(int(str(kl[t - i - 1])))
	w += kl[t:]
	return w
for i in kl:
	a.append(i)
a.sort()
b = 0
c = 0
for i in range(n - 1, 0, -1):
	if kl[i] < kl[i - 1]:
		b = i
		j = 1
		while kl[i - j] <= kl[i - j - 1] and i - j > 0:
			j += 1
		if ppedy(i - j + 1, b + 1) == a:
			print('yes')
			print(str(i - j + 1) + ' ' + str(b + 1))
		else:
			print('no')
		c = 1
		break
if c == 0:
	print('yes')
	print('1 1')


n = int(input())
a = list(map(int, input().split()))

def find(a):
	i = l = r = 0
	while i + 1 < len(a) and a[i] <= a[i + 1]:
		i += 1
	if i + 1 == len(a):
		return (0, 0)
	l = i
	while i + 1 < len(a) and a[i] >= a[i + 1]:
		i += 1
	if i + 1 == len(a):
		if l - 1 < 0 or a[len(a) - 1] > a[l - 1]:
			return (l, len(a) - 1)
		else:
			return None
	r = i
	if r + 1 < len(a) and a[l] > a[r + 1] or (l - 1 > 0 and a[r] < a[l - 1]):
		return None
	while i + 1 < len(a) and a[i] <= a[i + 1]:
		i += 1
	if i != len(a) - 1:
		return None
	else:
		return (l, r)
res = find(a)
if res == None:
	print('no')
else:
	print('yes')
	print(res[0] + 1, res[1] + 1)


n = int(input())
l1 = list(map(int, input().split()))
l2 = [x for x in l1]
l2.sort()
if l1 == l2:
	print('yes')
	print(1, 1)
	exit(0)
i = 0
j = n - 1
while i < n:
	if l2[i] != l1[i]:
		break
	i += 1
while j >= 0:
	if l2[j] != l1[j]:
		break
	j -= 1
arr1 = l1[0:i]
arr2 = l1[i:j + 1]
arr3 = l1[j + 1:n]
m = len(arr2)
for k in range(m // 2):
	(arr2[k], arr2[m - k - 1]) = (arr2[m - k - 1], arr2[k])
l1 = arr1 + arr2 + arr3
if l1 == l2:
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


N = int(input())
A = list(map(int, input().split()))
sorted_A = sorted(A)
miss_index = []
for i in range(N):
	if A[i] != sorted_A[i]:
		miss_index.append(i)
if len(miss_index) == 0:
	print('yes')
	print('1 1')
	exit()
left = miss_index[0]
right = miss_index[-1]
rev_A = A[:left] + A[left:right + 1][::-1] + A[right + 1:]
for i in range(N):
	if sorted_A[i] != rev_A[i]:
		print('no')
		exit()
print('yes')
print('{} {}'.format(left + 1, right + 1))


size = int(input())
arr = list(map(int, input().split()))
bg = arr[0]
bg_pos = 0
end = arr[0]
end_pos = 0
flag = False
for x in range(size - 1):
	if arr[x] > arr[x + 1] and flag == False:
		bg = arr[x]
		bg_pos = x
		end = arr[x + 1]
		end_pos = x + 1
		flag = True
	elif arr[x] > arr[x + 1] and flag == True:
		end = arr[x + 1]
		end_pos = x + 1
	elif arr[x] < arr[x + 1] and flag == True:
		end = arr[x]
		end_pos = x
		break

def reverse(arr, bg_pos, end_pos):
	aux = arr[bg_pos:end_pos + 1]
	aux.reverse()
	new_arr = []
	new_arr.extend(arr[:bg_pos])
	new_arr.extend(aux)
	new_arr.extend(arr[end_pos + 1:])
	return new_arr

def checkorder(arr):
	for x in range(size - 1):
		if arr[x] > arr[x + 1]:
			return False
	return True
arr = reverse(arr, bg_pos, end_pos)
if checkorder(arr):
	print('yes')
	print(bg_pos + 1, end_pos + 1)
else:
	print('no')


count = map(int, input())
array = list(map(int, input().split()))
sorted_array = sorted(array)
indices = []
for i in range(0, len(array)):
	if array[i] != sorted_array[i]:
		indices.append(i)
if len(indices) == 0:
	print('yes')
	print('1 1')
	exit()
reversed_segment = list(reversed(array[indices[0]:indices[-1] + 1]))
if reversed_segment == sorted_array[indices[0]:indices[-1] + 1]:
	print('yes')
	print(str(indices[0] + 1) + ' ' + str(indices[-1] + 1))
	exit()
print('no')


(n, a) = (int(input()), [int(i) for i in input().split()])
b = list(a)
b.sort()
(start, end) = (0, 0)
for (i, bi) in enumerate(b):
	if bi != a[i]:
		start = i
		break
for i in range(n - 1, 0, -1):
	if b[i] != a[i]:
		end = i
		break
c = a[start:end + 1]
c.reverse()
if start > end or c != b[start:end + 1]:
	print('no')
else:
	print('yes')
	print(start + 1, end + 1)


import sys
import math
import collections

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):
	n = int(input())
	arr = get_list()
	if arr == sorted(arr):
		print('yes')
		print(1, 1)
		continue
	pos = 0
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			pos = i
			break
	count = 0
	for i in range(pos, n - 1):
		if arr[i] >= arr[i + 1]:
			count += 1
		else:
			break
	i = pos
	j = pos + count
	while i <= j:
		(arr[i], arr[j]) = (arr[j], arr[i])
		i += 1
		j -= 1
	if sorted(arr) == arr:
		print('yes')
		print(pos + 1, pos + count + 1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
a = sorted(arr)
left = 0
i = 0
while i < n and arr[i] == a[i]:
	i += 1
left = i
if left == n:
	print('yes')
	print('1 1')
else:
	right = n - 1
	i = n - 1
	while i >= 0 and arr[i] == a[i]:
		i -= 1
	right = i
	i = left
	j = right
	while i <= right and j >= left and (arr[i] == a[j]):
		i += 1
		j -= 1
	if i == right + 1 and j == left - 1:
		print('yes')
		print(str(left + 1) + ' ' + str(right + 1))
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
b = sorted(l)
(x, y, f, c) = (1, 1, 0, [])
for i in range(n):
	if l[i] != b[i]:
		c.append(i + 1)
if len(c) > 0:
	(x, y) = (min(c), max(c))
if list(l[x - 1:y][::-1]) == b[x - 1:y]:
	print('yes')
	print(x, y)
else:
	print('no')


n = int(input())
ar = list(map(int, input().split()))
br = ar.copy()
br.sort()
if ar == br:
	print('yes')
	print('1 1')
else:
	for i in range(n):
		if ar[i] != br[i]:
			start = i
			break
	for i in range(n):
		if ar[i] != br[i]:
			end = i
	digit = []
	for i in range(start, end + 1):
		digit.append(br[i])
	digit.reverse()
	if ar[start:end + 1] == digit:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


n = int(input()) + 2
a = [float('-inf')] + list(map(int, input().split())) + [float('inf')]
is_smaller = [False for _ in range(n)]
for i in range(1, n):
	if a[i] < a[i - 1]:
		is_smaller[i] = True
if True not in is_smaller:
	print('yes')
	print(1, 1)
else:
	found = False
	writing = False
	start = 0
	end = 0
	for i in range(n):
		if found:
			if is_smaller[i]:
				print('no')
				break
		elif not writing:
			if is_smaller[i]:
				start = i
				writing = True
		elif not is_smaller[i]:
			end = i - 1
			found = True
	else:
		if a[end] > a[start - 2] and a[start - 1] < a[end + 1]:
			print('yes')
			print(start - 1, end)
		else:
			print('no')


n = int(input())
a = [int(i) for i in input().split()]
lg = -1
pg = -1
kol = 0
otv = 'yes'
for i in range(1, len(a)):
	if a[i] < a[i - 1]:
		if lg == -1:
			lg = i - 1
		elif pg != -1:
			otv = 'no'
			break
	elif lg != -1 and pg == -1:
		pg = i - 1
		if a[i] < a[lg]:
			otv = 'no'
			break
		if lg > 0:
			if a[lg - 1] > a[pg]:
				otv = 'no'
				break
if lg == -1:
	lg = 0
	pg = 0
if pg == -1:
	pg = len(a) - 1
	if lg > 0:
		if a[lg - 1] > a[pg]:
			otv = 'no'
print(otv)
if otv != 'no':
	print(lg + 1, pg + 1)


def isSorted(l):
	i = 1
	while i < len(l):
		if l[i] < l[i - 1]:
			return False
		i += 1
	return True
n = int(input())
a = list(map(int, input().split()))
s = e = 0
i = 1
b = list()
while i < len(a):
	if a[i] > a[i - 1]:
		i += 1
	else:
		s = i - 1
		while i < n and a[i] < a[i - 1]:
			i += 1
		e = i - 1
		b = a[0:s] + list(reversed(a[s:e + 1])) + a[e + 1:]
		break
if isSorted(b):
	print('yes')
	print(s + 1, e + 1, sep=' ')
else:
	print('no')


n = int(input())
A = list(map(int, input().split()))
B = sorted(A)
s = t = -1
for i in range(n):
	if A[i] != B[i]:
		s = i
		break
if s == -1:
	print('yes')
	print(1, 1)
	exit()
for i in range(n - 1, -1, -1):
	if A[i] != B[i]:
		t = i + 1
		break
A = A[:s] + A[s:t][::-1] + A[t:]
if A == B:
	print('yes')
	print(s + 1, t)
else:
	print('no')


def count(l):
	c = 0
	i = 0
	j = 0
	i1 = 0
	i2 = 0
	while i < len(l) - 1:
		if l[i] > l[i + 1]:
			c += 1
			for j in range(i, len(l) - 1):
				if l[j] < l[j + 1]:
					i1 = i + 1
					i2 = j + 1
					i = j
					break
				elif j == len(l) - 2:
					i1 = i + 1
					i2 = n
		if j == len(l) - 2:
			break
		else:
			i += 1
	return (c, i1 - 1, i2 - 1)
n = int(input())
l = list(map(int, input().split()))
m = []
for i in l:
	m.append(i)
m.sort()
(c, x, y) = count(l)
if c == 0:
	print('yes')
	print(1, 1)
elif c == 1:
	temp = []
	temp = l[x:y + 1]
	temp.reverse()
	l[x:y + 1] = temp
	if l == m:
		print('yes')
		print(x + 1, y + 1)
	else:
		print('no')
else:
	print('no')


def f(a, n):
	s = 0
	while s < n - 1 and a[s] < a[s + 1]:
		s += 1
	if s == n - 1:
		return (True, 0, 0)
	maxs = float('-inf') if s == 0 else a[s - 1]
	e = n - 1
	while e > 0 and a[e] > a[e - 1]:
		e -= 1
	mine = float('inf') if e == n - 1 else a[e + 1]
	if maxs < a[e] and mine > a[s]:
		(ts, te) = (s, e)
		while ts != te and a[ts] > a[ts + 1]:
			ts += 1
		if ts == te:
			return (True, s, e)
		else:
			return (False, -1, -1)
	else:
		return (False, -1, -1)
n = int(input())
a = list(map(int, input().split()))
(possible, start, end) = f(a, n)
if possible:
	print('yes')
	print('{} {}'.format(start + 1, end + 1))
else:
	print('no')


n = int(input())
a = list(map(int, input().split(' ')))
b = sorted(a)
i = l = r = 0
while i < n:
	if a[i] != b[i]:
		l = i
		break
	i += 1
j = n - 1
while j >= 0:
	if a[j] != b[j]:
		r = j
		break
	j -= 1
if a == b:
	print('yes')
	print('1 1')
elif a[l:r + 1][::-1] == b[l:r + 1]:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
from math import ceil
n = ip()
li = ai()
x = sorted(li)
if li == x:
	print('yes')
	print(1, 1)
	exit()
c = 0
f = []
for i in range(n):
	if li[i] != x[i]:
		f.append(i)
		for j in range(i + 1, n):
			if li[j] == x[i]:
				f.append(j)
				c += 1
				break
	if c > 0:
		break
ans = li[:i] + li[i:j + 1][::-1] + li[j + 1:]
if x == ans:
	print('yes')
	print(f[0] + 1, f[1] + 1)
else:
	print('no')


n = int(input())
seq = [int(x) for x in input().split()]
lista = seq.copy()
lista.sort()
ordenada = True
for i in range(1, n):
	if seq[i - 1] > seq[i]:
		ordenada = False
		x = i - 1
		p = i + 1
		while p < n:
			if seq[p - 1] < seq[p]:
				break
			p += 1
		break
if ordenada:
	print('yes')
	print('1 1')
else:
	teste = seq[x:p]
	irineu = []
	for i in range(len(teste) - 1, -1, -1):
		irineu.append(teste[i])
	seq[x:p] = irineu
	if seq == lista:
		print('yes')
		print('%d %d' % (x + 1, p))
	else:
		print('no')


def sta(a):
	lb = -float('inf')
	rb = float('inf')
	left = 0
	while left < len(a) - 1:
		if a[left] > a[left + 1]:
			break
		lb = a[left]
		left = left + 1
	if left == len(a) - 1:
		return (1, 1)
	right = len(a) - 1
	while right > left:
		if a[right] < a[right - 1]:
			break
		rb = a[right]
		right = right - 1
	if a[right] < lb or a[right] > rb:
		return
	for i in range(left, right):
		if a[i] < lb or a[i] > rb:
			return
		if a[i] < a[i + 1]:
			return
	return (left + 1, right + 1)
input()
a = [int(x) for x in input().split(' ')]
res = sta(a)
if res is not None:
	print('yes')
	print(res[0], res[1])
else:
	print('no')


import re
array_size = input()
array = [int(i) for i in input().split()]
diff = ''.join(('+' if i == si else '-' for (i, si) in zip(array, sorted(array))))
try:
	(i, j) = (diff.index('-'), diff.rindex('-'))
except ValueError:
	(i, j) = (0, 0)
if sorted(array) == array[:i] + array[i:j + 1][::-1] + array[j + 1:]:
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
sa = sorted(a)
if a == sa:
	print('yes')
	print('1 1')
else:
	x = [a[y] for y in range(n) if a[y] != sa[y]]
	(a1, a2) = (a.index(x[0]) + 1, a.index(x[-1]) + 1)
	if x == sorted(x)[::-1] and a[:a1 - 1] + a[a1 - 1:a2][::-1] + a[a2:] == sorted(a):
		print('yes')
		print(a1, a2)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
temp = sorted(a)
pos = []
for i in range(n):
	if a[i] != temp[i]:
		pos.append(i)
if not pos:
	print('yes')
	print(1, 1)
	exit()
a[pos[0]:pos[len(pos) - 1] + 1] = reversed(a[pos[0]:pos[len(pos) - 1] + 1])
for i in range(n):
	if a[i] != temp[i]:
		print('no')
		exit()
print('yes')
print(pos[0] + 1, pos[len(pos) - 1] + 1)


n = int(input())
l = list(map(int, input().split()))
k = l.copy()
k.sort()
u = []
j = []
if k == l:
	print('yes')
	print('1', '1')
else:
	for i in range(n):
		if l[i] == k[i]:
			pass
		else:
			j.append(i)
	u = l[j[0]:j[-1] + 1]
	m = u.copy()
	u.sort()
	u.reverse()
	if u == m and len(u) == j[-1] - j[0] + 1:
		print('yes')
		print(j[0] + 1, j[-1] + 1)
	else:
		print('no')


def isOneSeg(lst):
	if len(lst) <= 2:
		if sorted(lst) == lst:
			return ['yes', '1 1']
		else:
			return ['yes', '1 2']
	decreasing = False
	increasing = False
	for i in range(len(lst)):
		if i > 0:
			if lst[i - 1] > lst[i] and increasing:
				return 'no'
			if lst[i - 1] > lst[i]:
				decreasing = True
			if decreasing and lst[i] > lst[i - 1]:
				increasing = True
	if not decreasing:
		return ['yes', '1 1']
	decreasing = False
	maximum = None
	minimum = None
	if lst[-1] <= lst[-2]:
		lst = lst + [10 ** 10]
	for i in range(len(lst)):
		if i > 0:
			if lst[i] > lst[i - 1] and decreasing:
				if not minimum:
					minimum = i - 1
					if maximum > 0:
						if lst[minimum] < lst[maximum - 1]:
							return 'no'
				if lst[maximum] > lst[i]:
					return 'no'
			if lst[i - 1] > lst[i] and (not decreasing):
				decreasing = True
				maximum = i - 1
	return ['yes', '%s %s' % (maximum + 1, minimum + 1)]
n = int(input())
lst = [int(x) for x in input().split()]
res = isOneSeg(lst)
if type(res) == list:
	print(res[0])
	print(res[1])
else:
	print(res)


n = int(input())
ar = list(map(int, input().split()))
a = []
for i in ar:
	a.append(i)
a.sort()
p = 0
pp = 0
for i in range(n):
	if a[i] != ar[i]:
		if p == 0:
			p = i + 1
		else:
			pp = i + 1
if p == 0:
	print('yes')
	print('1 1')
else:
	f = []
	f = ar[:p - 1]
	f += ar[pp - 1:p - 1:-1]
	f.append(ar[p - 1])
	f += ar[pp:]
	if f == a:
		print('yes')
		print(str(p) + ' ' + str(pp))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
s = 0
e = n - 1
s0 = True
s1 = False
s2 = False
s3 = False
for j in range(1, n):
	if s0 and a[j] < a[j - 1]:
		s0 = False
		s = j - 1
		s1 = True
	elif s1 and a[j] > a[j - 1]:
		s2 = True
		e = j - 1
		s1 = False
	elif s2 and a[j] < a[j - 1]:
		s2 = False
		s3 = True
if s0:
	print('yes')
	print(1, 1)
elif s2 and (a[s - 1] < a[e] or s == 0) and (a[s] < a[e + 1] or e + 1 == n):
	print('yes')
	print(s + 1, e + 1)
elif s1 and (a[n - 1] > a[s - 1] or s == 0):
	print('yes')
	print(s + 1, n)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
l = -1
r = -1
b = sorted(a)
for i in range(n - 1):
	if a[i] > a[i + 1]:
		l = i
		break
for i in range(n - 1, 0, -1):
	if a[i] < a[i - 1]:
		r = i
		break
if l == -1 or r == -1:
	print('yes')
	print(1, 1)
else:
	a[l:r + 1] = reversed(a[l:r + 1])
	if len([i for i in range(n) if a[i] != b[i]]) == 0:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
x = list(map(int, input().split()))
x.append(max(x) + 1)
b = 0
c = 0
for i in range(0, n):
	if x[i] > x[i + 1]:
		b = i
		a = i - 1
		break
c = b
ans = 0
for i in range(b, n):
	if x[i] < x[i + 1]:
		c = i
		d = i + 1
		break
	if x[i] < x[a]:
		ans = 1
m = x[b:c + 1]
m.sort()
m = x[0:b] + m + x[c + 1:]
x.sort()
if m == x:
	print('yes')
	print(b + 1, c + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
s = sorted(a)
t = sorted(a, reverse=True)
st = 0
en = 0
if a == s:
	print('yes')
	print(1, 1)
	quit()
for i in range(n):
	if a[i] != s[i]:
		st = i
		break
for i in range(n):
	if a[-i - 1] != t[i]:
		en = -i - 1
		break
if en == -1:
	tr = list(reversed(a[st:]))
	c = a[0:st] + tr
else:
	tr = list(reversed(a[st:en + 1]))
	c = a[0:st] + tr + a[en + 1:]
if c == s:
	print('yes')
	print(st + 1, en + n + 1)
else:
	print('no')


n = int(input())
A = list(map(int, input().split()))
sA = sorted(A)
pa = 1
while pa <= n and A[pa - 1] == sA[pa - 1]:
	pa = pa + 1
if pa == n + 1:
	print('yes\n1 1')
else:
	pb = n
	while pb >= 1 and A[pb - 1] == sA[pb - 1]:
		pb = pb - 1
	AB = A[pa - 1:pb]
	rAB = reversed(AB)
	sAB = sA[pa - 1:pb]
	can = sum((1 for (x, y) in zip(sAB, rAB) if x != y))
	if can == 0:
		print('yes')
		print(pa, pb)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
arr1 = arr[:]
arr.sort()
l = -1
r = -1
for i in range(n):
	if arr[i] != arr1[i]:
		r = i
for i in range(n - 1, -1, -1):
	if arr[i] != arr1[i]:
		l = i
if l == -1 and r == -1:
	print('yes\n1 1')
	exit()
arr1[l:r + 1] = arr1[l:r + 1][::-1]
for i in range(n):
	if arr[i] != arr1[i]:
		print('no')
		exit()
print('yes')
print(l + 1, r + 1)


n = int(input())
input = input()
main_array = [int(i) for i in input.split()]
sorted_array = sorted(main_array)
(x, y) = (0, 0)
for i in range(n):
	if sorted_array[i] != main_array[i]:
		x = i
		break
if x != n:
	for i in range(n - 1, -1, -1):
		if sorted_array[i] != main_array[i]:
			y = i
			break
main_array[x:y + 1] = main_array[x:y + 1][::-1]
if main_array == sorted_array:
	print('yes')
	print(f'{x + 1} {y + 1}')
else:
	print('no')


import math

def get_primes(prime_supr):
	is_prime = [0] * 2 + [1] * prime_supr
	for i in range(2, int(math.sqrt(prime_supr)) + 1):
		if is_prime[i]:
			for j in range(i * i, prime_supr + 1, i):
				is_prime[j] = 0
	return is_prime
get_int = lambda : map(int, input().split())
n = int(input())
a = list(get_int())
s = f = 0
b = sorted(a)
for i in range(n):
	if a[i] != b[i]:
		s = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		f = i
		break
c = a[:s] + list(reversed(a[s:f + 1])) + a[f + 1:]
if a == b:
	print('yes\n1 1')
elif c == b:
	print('yes\n{0} {1}'.format(s + 1, f + 1))
else:
	print('no')


n = int(input())
a = [int(i) for i in input().split()]
x = 0
y = 0
c = False
k = 0
answ = 'yes'
for i in range(1, n):
	if a[i] == a[i - 1]:
		print('no')
		break
	if a[i] < a[i - 1]:
		if k == 0 and c:
			print('no')
			break
		elif not c:
			x = i - 1
			k += 1
			c = True
		else:
			k += 1
	elif k > 0:
		y = x + k
		k = 0
		if x != 0 and a[y] <= a[x - 1] or (y != n - 1 and a[x] >= a[y + 1]):
			print('no')
			break
else:
	if k > 0:
		y = x + k
		k = 0
		if x != 0 and a[y] <= a[x - 1] or (y != n - 1 and a[x] >= a[y + 1]):
			print('no')
		else:
			print('yes')
			print(x + 1, y + 1)
	else:
		print('yes')
		print(x + 1, y + 1)


n = int(input())
a = list(map(int, input().split()))
d = list()
for i in range(n):
	if i == 0:
		d.append(0)
	else:
		d.append(a[i] - a[i - 1])
if n > 1:
	flag = 'Up' if d[1] > 0 else 'Down'
	initflag = flag
	upToDown = 0
	downToUp = 0
	ud = 0
	du = 0
	answer = ''
	if initflag == 'Up':
		for j in range(n):
			if upToDown > 1 or downToUp > 1:
				answer = 'no'
				break
			if j > 0 and d[j] > 0 and (flag == 'Down'):
				downToUp += 1
				flag = 'Up'
				du = j - 1
			if j > 0 and d[j] < 0 and (flag == 'Up'):
				upToDown += 1
				flag = 'Down'
				ud = j - 1
		if ud != 0 and du == 0 and (flag == 'Down'):
			du = n - 1
	else:
		for j in range(n):
			if upToDown > 0 or downToUp > 1:
				answer = 'no'
				break
			if j > 0 and d[j] > 0 and (flag == 'Down'):
				downToUp += 1
				flag = 'Up'
				du = j - 1
			if j > 0 and d[j] < 0 and (flag == 'Up'):
				upToDown += 1
				flag = 'Down'
	if initflag == 'Up' and (upToDown > 1 or downToUp > 1):
		answer = 'no'
	elif initflag == 'Down' and (upToDown > 0 or downToUp > 1):
		answer = 'no'
	elif du != ud or du != 0:
		if du + 1 < n and a[ud] > a[du + 1]:
			answer = 'no'
		elif ud - 1 >= 0 and a[du] < a[ud - 1]:
			answer = 'no'
		elif initflag == 'Down' and (du + 1 < n and a[du + 1] < a[0]):
			answer = 'no'
		else:
			answer = 'yes'
	else:
		answer = 'yes'
	print(answer)
	if answer == 'yes':
		if du == ud and du == 0:
			if flag == 'Down':
				print('{} {}'.format(1, n))
			else:
				print('{} {}'.format(1, 1))
		elif initflag == 'Down':
			print('{} {}'.format(1, du + 1))
		else:
			print('{} {}'.format(ud + 1, du + 1))
else:
	print('yes')
	print('1 1')


n = int(input())
a = list(map(int, input().split()))
asort = sorted(a)
first = True
start = 0
isseg = False
segArray = []
if asort == a:
	print('yes')
	print('{} {}'.format(1, 1))
else:
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			if first:
				start = i
				first = False
		elif not first:
			isseg = True
			end = i
			result = a[0:start] + a[end:start:-1] + a[start:start + 1] + a[end + 1:]
			break
		else:
			continue
	if not isseg:
		if start == 0:
			print('yes')
			print('{} {}'.format(1, n))
		else:
			end = n - 1
			result = a[0:start] + a[end:start:-1] + a[start:start + 1] + a[end + 1:]
			if result == asort:
				print('yes')
				print('{} {}'.format(start + 1, end + 1))
			else:
				print('no')
	elif result == asort:
		print('yes')
		print('{} {}'.format(start + 1, end + 1))
	else:
		print('no')


def inp():
	return map(int, input().split())

def arr_inp():
	return [int(x) for x in input().split()]

def print_arr(arr):
	print(*arr, sep=' ')
n = int(input())
a = arr_inp()
a_sort = sorted(a)
(max, ix) = (a[0], 0)
(l, h) = (0, 0)
if a == a_sort:
	print('yes')
	print(1, 1)
	exit()
for i in range(n):
	if a[i] != a_sort[i]:
		l = i
		break
for i in range(n - 1, 0, -1):
	if a[i] != a_sort[i]:
		h = i
		break
a[l:h + 1] = list(reversed(a[l:h + 1]))
if a == a_sort:
	print('yes')
	print(l + 1, h + 1)
	exit()
print('no')


n = int(input())
a = [int(x) for x in input().split()]
sorted_copy = a.copy()
sorted_copy.sort()
i = 0
j = n - 1
L_exist = False
R_exist = False
while i < n - 1:
	if a[i] > a[i + 1]:
		L = i
		L_exist = True
		break
	i += 1
while j > -1:
	if a[j] < a[j - 1]:
		R = j
		R_exist = True
		break
	j -= 1
if L_exist and R_exist:
	a[L:R + 1] = reversed(a[L:R + 1])
	if a == sorted_copy:
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')
else:
	print('yes')
	print('1 1')


a = int(input())
l = list(map(int, input().split()))
(lw, h) = (a, 0)
for i in range(1, a):
	if l[i - 1] > l[i]:
		lw = i - 1
		break
for i in range(a - 2, -1, -1):
	if l[i + 1] < l[i]:
		h = i + 1
		break
if lw == a and h == 0:
	lw = hw = 0
else:
	v = l[lw:h + 1]
	l = l[:lw] + v[::-1] + l[h + 1:]
for i in range(1, a):
	if l[i - 1] > l[i]:
		print('no')
		break
else:
	print('yes')
	print(lw + 1, h + 1)


n = int(input())
a = list(map(int, input().split()))
b = a[:]
data = {}
a.sort()
for i in range(n):
	data[a[i]] = i
for i in range(n):
	b[i] = data[b[i]]
(L, R) = (-1, -1)
for i in range(n):
	if b[i] != i:
		L = i
		break
for i in range(n - 1, -1, -1):
	if b[i] != i:
		R = i
		break
if L == -1 and R == -1:
	print('yes\n1 1')
else:
	b[L:R + 1] = b[L:R + 1][::-1]
	ok = True
	for i in range(n):
		if b[i] != i:
			ok = False
	if ok:
		print('yes\n' + str(L + 1), R + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
i = 1
seg = []
while i < n:
	if a[i] < a[i - 1]:
		l = i - 1
		while i < n and a[i] < a[i - 1]:
			i += 1
		r = i - 1
		seg.append([l, r])
	else:
		i += 1
if len(seg) > 1:
	print('no')
elif len(seg) == 0:
	print('yes')
	print(1, 1)
elif seg[0][1] < n - 1 and a[seg[0][0]] > a[seg[0][1] + 1] or (seg[0][0] > 0 and a[seg[0][1]] < a[seg[0][0] - 1]):
	print('no')
else:
	print('yes')
	print(seg[0][0] + 1, seg[0][1] + 1)


n = int(input())
a = list(map(int, input().split()))
found_decreasing_segment = False
start_segment = 0
end_segment = 0
i = 0
while i < n - 1:
	if a[i] > a[i + 1]:
		if found_decreasing_segment:
			print('no')
			exit()
		start_segment = i
		found_decreasing_segment = True
		while i < n - 1 and a[i] > a[i + 1]:
			i += 1
		end_segment = i
		if end_segment < n - 1 and a[start_segment] > a[end_segment + 1] or (start_segment > 0 and a[end_segment] < a[start_segment - 1]):
			print('no')
			exit()
	else:
		i += 1
print('yes')
print(start_segment + 1, end_segment + 1, sep=' ')


n = int(input())
a = [int(x) for x in input().split()]
sa = sorted(a)
(left, rite) = (0, n - 1)
if a == sa:
	print('yes')
	print('1 1')
else:
	while a[left] == sa[left]:
		left += 1
	while a[rite] == sa[rite]:
		rite -= 1
	if a[left:rite + 1] == sa[left:rite + 1][::-1]:
		print('yes')
		print(1 + min(left, rite), 1 + max(left, rite))
	else:
		print('no')


def longest_run(L, n):
	inc_list = []
	check = 0
	for i in range(n - 1):
		count = 0
		j = i
		if L[i] >= L[i + 1]:
			check += 1
			while j + 1 < n and L[j] >= L[j + 1]:
				count += 1
				j += 1
			if count > 0:
				inc_list = L[i:j + 1]
				inc_list.reverse()
				if sorted(L) == L[:i] + inc_list + L[j + 1:]:
					return (i, j)
			i = j
			if check > 1:
				break
	return False
n = int(input())
L = [int(b_temp) for b_temp in input().strip().split(' ')]
if sorted(L) == L:
	print('yes')
	print('1 1')
else:
	b = longest_run(L, n)
	if b != False:
		print('yes')
		print(str(b[0] + 1) + ' ' + str(b[1] + 1))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
L = 0
R = n - 1
while L < n - 1 and a[L] < a[L + 1]:
	L += 1
while R > 0 and a[R - 1] < a[R]:
	R -= 1
if L > R:
	print('yes\n1 1')
else:
	p = a[L:R + 1]
	p.reverse()
	q = a[:L] + p + a[R + 1:]
	if sorted(q) == q:
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
increasing = True
(i1, i2) = (0, 0)
found_decreasing_section = False
for j in range(n - 1):
	if a[j] < a[j + 1]:
		if not increasing:
			i2 = j
			found_decreasing_section = True
			if i1 - 1 >= 0 and a[i2] < a[i1 - 1]:
				print('no')
				quit()
			if i2 + 1 < n and a[i1] > a[i2 + 1]:
				print('no')
				quit()
		increasing = True
	else:
		if found_decreasing_section:
			print('no')
			quit()
		if increasing:
			i1 = j
		increasing = False
if not increasing:
	i2 = n - 1
if i1 - 1 >= 0 and a[i2] < a[i1 - 1]:
	print('no')
	quit()
if i2 + 1 < n and a[i1] > a[i2 + 1]:
	print('no')
	quit()
print('yes')
print(i1 + 1, i2 + 1)


n = int(input())
a = list(map(int, input().split()))
b = a[:]
a.sort()
l = 0
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
r = 0
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		r = i
		break
i = l
j = r
while i < j:
	tmp = b[i]
	b[i] = b[j]
	b[j] = tmp
	i += 1
	j -= 1
flag = True
for i in range(l, r + 1):
	if a[i] != b[i]:
		flag = False
if flag:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
left = 0
right = 0
while left < n - 1:
	if a[left] < a[left + 1]:
		left += 1
		right = left
	else:
		break
while right < n - 1:
	if a[right] > a[right + 1]:
		right += 1
	else:
		break
if left == right:
	print('yes')
	print('1 1')
else:
	a[left:right + 1] = reversed(a[left:right + 1])
	if a == b:
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
	b.append(a[i])
b.sort()
p = []
for i in range(n):
	if a[i] != b[i]:
		p.append(i)
if len(p) == 0:
	k = 0
	l = 0
else:
	k = p[0]
	l = p[-1]
a = a[k:l + 1]
a = a[::-1]
if a == b[k:l + 1]:
	print('yes')
	print(k + 1, l + 1)
else:
	print('no')


n = int(input())
arr = [int(i) for i in input().split()]
i1 = 0
i2 = 0
for i in range(1, n):
	if arr[i] < arr[i - 1]:
		i1 = i - 1
		break
for i in range(1, n + 1):
	if arr[n - i] < arr[n - i - 1]:
		i2 = n - i
		break
arr[i1:i2 + 1] = reversed(arr[i1:i2 + 1:1])
if arr == sorted(arr):
	print('yes')
	print(i1 + 1, i2 + 1)
else:
	print('no')


def main():
	n = int(input())
	a = [int(i) for i in input().split()]
	k1 = 0
	k2 = 0
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			k1 = i
			j = i + 1
			while j < n:
				if a[i] > a[j]:
					j += 1
				else:
					break
			k2 = j - 1
			break
	if a[:k1] + a[k1:k2 + 1][::-1] + a[k2 + 1:] == sorted(a):
		print(f'yes\n{k1 + 1} {k2 + 1}')
	else:
		print('no')
main()


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = ip()
arr = lip()
final = sorted(arr)
lst = []
for i in range(n):
	if arr[i] != final[i]:
		lst.append(i)
if lst != []:
	start = min(lst)
	last = max(lst)
	lst = arr[:start] + arr[start:last + 1][::-1] + arr[last + 1:]
	if lst == final:
		print('yes')
		print(start + 1, last + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


n = int(input().strip())
a = [int(x) for x in input().strip().split()]
dec_list = []
x = -1
for i in range(1, n):
	if a[i - 1] > a[i]:
		if x == -1:
			x = i
	elif x != -1:
		if a[x - 1] > a[i]:
			dec_list.extend([(-1, -1)])
			break
		dec_list.append((x, i))
		x = -1
if x != -1:
	if a[x - 2] > a[n - 1] and x != 1:
		dec_list.append([-1, -1])
	dec_list.append((x, n))
if len(dec_list) <= 1:
	print('yes')
	if len(dec_list) == 0:
		print('1 1')
	else:
		print(str(dec_list[0][0]) + ' ' + str(dec_list[0][1]))
else:
	print('no')


n = int(input())
s = list(map(int, input().split()))
m = sorted(s)
if s == m:
	print('yes')
	print(1, 1)
else:
	(a, c, e, o) = ([], [], [], 0)
	for i in s:
		if i == m[o]:
			a.append(i)
		else:
			break
		o += 1
	o = 0
	s.reverse()
	m.reverse()
	for i1 in s:
		if i1 == m[o]:
			c.append(i1)
		else:
			break
		o += 1
	c.reverse()
	s.reverse()
	x = s[len(a):n - len(c)]
	x.reverse()
	m.reverse()
	if m == a + x + c:
		print('yes')
		print(len(a) + 1, n - len(c))
	else:
		print('no')


n = int(input())
array = list(map(int, input().split()))
if n == 1:
	print('yes')
	print(*(1, 1))
	exit()
dsc = 0
l = r = None
for i in range(n):
	if i == 0:
		if array[i + 1] < array[i]:
			dsc = 1
			l = 0
	elif dsc == 0:
		if array[i] < array[i - 1]:
			dsc = 1
			l = i - 1
	elif array[i] > array[i - 1]:
		dsc = 0
		r = i - 1
		break
if l == None:
	print('yes')
	print(*(1, 1))
elif r == None:
	ans = array[:l] + array[l:][::-1]
	if ans == sorted(array):
		print('ye' + 's')
		print(*(l + 1, n))
	else:
		print('no')
else:
	ans = array[:l] + array[l:r + 1][::-1] + array[r + 1:]
	if ans == sorted(array):
		print('yes')
		print(*(l + 1, r + 1))
	else:
		print('no')


n = int(input())
a = list(map(int, input().strip().split()))
b = [i for i in a]
coun = 0
if sorted(b) == a:
	print('yes')
	print(1, 1)
else:
	for i in range(len(a) - 1):
		if a[i + 1] < a[i]:
			j = i
			temp = i
			while j < len(a) - 1 and a[j + 1] < a[j]:
				j = j + 1
			break
	a[i:j + 1] = sorted(a[i:j + 1])
	if sorted(b) == a:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
(i, j) = (0, 0)
for a in range(1, n):
	if l[a] < l[a - 1]:
		i = a - 1
		for k in range(a, n):
			if l[i] > l[k]:
				j = k
		break
count = 0
l = l[:i] + list(reversed(l[i:j + 1])) + l[j + 1:]
for a in range(n - 1):
	if l[a] < l[a + 1]:
		count += 1
if count == n - 1:
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


sa = int(input())
sa2 = input().split(' ')
nums = [int(x) for x in sa2]
diffs = [nums[x + 1] - nums[x] for x in range(sa - 1)]
listx = [x for x in range(sa - 1) if diffs[x] < 0]
if listx == []:
	print('yes')
	print('1 1')
else:
	magic = nums[listx[0]:listx[-1] + 2]
	magic.reverse()
	nums[listx[0]:listx[-1] + 2] = magic
	mark = 0
	for t in range(sa - 1):
		if nums[t] - nums[t + 1] > 0:
			mark = 1
	if mark == 1:
		print('no')
	else:
		print('yes')
		print(listx[0] + 1, listx[-1] + 2)


n = int(input())
a = list(map(int, input().split()))
x = sorted(a)
c = []
l = 0
r = n - 1
flag = [True, True]
if x == a:
	print('yes')
	print(1, 1)
	exit()
while l < r:
	if a[l] != x[l] and flag[0] == True:
		flag[0] = False
		c.append(l)
	if a[r] != x[r] and flag[1] == True:
		flag[1] = False
		c.append(r)
	if flag[0] == False and flag[1] == False:
		break
	if flag[0] == True:
		l += 1
	if flag[1] == True:
		r -= 1
y = sorted(a[l:r + 1], reverse=True)
c = sorted(c)
if a[l:r + 1] == y:
	print('yes')
	print(c[0] + 1, c[1] + 1)
else:
	print('no')


ip = int(input())
n = [int(i) for i in input().split()]
arr = []
arr.append(-1)
for i in n:
	arr.append(i)
arr.append(1000000001)
t = 0
st = -1
et = -1
ans = 'yes'
for i in range(0, len(n) + 1):
	if arr[i] > arr[i + 1] and t == 0:
		t = 1
		st = i
	if arr[i] < arr[i + 1] and t == 1:
		t += 1
		et = i
if st == -1 and et == -1:
	st = et = 1
i = st
j = et + 1
arr[i:j] = sorted(arr[i:j], reverse=False)
for i in range(0, len(n) + 1):
	if arr[i + 1] < arr[i]:
		ans = 'no'
		break
print(ans)
if ans == 'yes':
	print(str(st) + ' ' + str(et))


n = int(input())
a = list(map(int, input().split()))
found = False
possible = True
started = False
f = 0
s = 0
for i in range(1, n):
	if a[i] < a[i - 1]:
		if found:
			possible = False
		elif not started:
			f = i
			started = True
	elif started:
		if a[f - 1] < a[i] and (f - 2 < 0 or a[f - 2] < a[i - 1]):
			found = True
			started = False
			s = i
		else:
			possible = False
if not found:
	if started:
		if f - 2 < 0 or a[f - 2] < a[n - 1]:
			s = n
		else:
			possible = False
	else:
		f = 1
		s = 1
if not possible:
	print('no')
else:
	print('yes')
	print(f, s)


n = int(input())
a = list(map(int, input().split()))
e = sorted(a)
g = sorted(a, reverse=True)
if a == e:
	print('yes')
	print(1, 1)
elif a == g:
	print('yes')
	print(1, n)
else:
	for i in range(n - 1):
		if a[i + 1] - a[i] < 0:
			b = i
			break
	for i in range(n - 1, 0, -1):
		if a[i - 1] - a[i] > 0:
			c = i
			break
	d = a[c - n:b - n - 1:-1]
	d = a[:b] + d + a[c + 1:]
	if d == e:
		print('yes')
		print(b + 1, c + 1)
	else:
		print('no')


from math import ceil

def solve():
	n = int(input())
	nums = list(map(int, input().split()))
	descending = False
	ret1 = ret2 = -1
	for i in range(1, n):
		if descending == False and nums[i] < nums[i - 1] and (ret1 == -1):
			descending = True
			ret1 = i - 1
		elif descending == True and nums[i] > nums[i - 1]:
			descending = False
			ret2 = i - 1
		elif descending == False and nums[i] < nums[i - 1]:
			return 'no'
	if descending:
		ret2 = i
	if ret1 == -1:
		ret1 = ret2 = 0
	for i in range(ceil((ret2 - ret1) / 2)):
		temp = nums[ret1 + i]
		nums[ret1 + i] = nums[ret2 - i]
		nums[ret2 - i] = temp
	for i in range(1, n):
		if nums[i] < nums[i - 1]:
			return 'no'
	else:
		return f'yes\n{ret1 + 1} {ret2 + 1}'
print(solve())


n = int(input())
s = input()
ar = s.split(' ')
a = []
arr = []
for i in range(n):
	a.insert(i, int(ar[i]))
	arr.insert(i, int(ar[i]))
arr.sort()
d = {}
for i in range(n):
	d[arr[i]] = i
for i in range(n):
	a[i] = d[a[i]]
p = []
start = -1
end = -1
for i in range(n):
	if a[i] != i:
		start = i
		break
for i in range(n - 1, 0, -1):
	if a[i] != i:
		end = i
		break
if start == -1 and end == -1:
	print('yes')
	print(1, 1)
	exit()
sublist = a[start:end + 1]
sublist.reverse()
a[start:end + 1] = sublist
flag = 0
for i in range(n):
	if a[i] != i:
		flag = 1
if not flag:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	(l, r) = (0, 0)
	for i in range(1, n):
		if arr[i] < arr[i - 1]:
			l = i - 1
			break
	for i in range(n - 2, -1, -1):
		if arr[i] > arr[i + 1]:
			r = i + 1
			break
	r_arr = arr[l:r + 1]
	check1 = arr[:l] + r_arr[::-1] + arr[r + 1:]
	check2 = sorted(arr)
	if check1 == check2:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')
main()


n = int(input())
a = [int(x) for x in input().split()]
s = sorted(a)
if a == s:
	print('yes')
	print('1 1')
else:
	x = [a[y] for y in range(n) if a[y] != s[y]]
	(a1, a2) = (a.index(x[0]) + 1, a.index(x[-1]) + 1)
	if x == sorted(x)[::-1] and a[:a1 - 1] + a[a1 - 1:a2][::-1] + a[a2:] == sorted(a):
		print('yes')
		print(a1, a2)
	else:
		print('no')


n = int(input())
arr = [int(x) for x in input().split()]
i = 0
(start, end) = (0, 0)
while i < n:
	if i < n - 1 and arr[i + 1] <= arr[i]:
		start = i
		while i < n - 1 and arr[i + 1] <= arr[i]:
			i += 1
		end = i
	i += 1
flag = True
arr[start:end + 1] = arr[start:end + 1][::-1]
i = 0
for i in range(n):
	if i < n - 1 and arr[i + 1] < arr[i]:
		flag = False
		break
if flag:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


def read_number_line():
	return [int(i) for i in input().split()]

def read_number():
	return int(input())
n = read_number()
a = read_number_line()
a.insert(0, 0)
sorted_a = sorted(a)
mapping = {}
for i in range(1, n + 1):
	mapping[sorted_a[i]] = i
for i in range(1, n + 1):
	a[i] = mapping[a[i]]
L = 0
R = 0
for i in range(1, n + 1):
	if not L and a[i] != i:
		L = i
	if L and a[i] != i:
		R = i
if L and R:
	segment = a[L:R + 1]
	segment.reverse()
	mapped_a = a[:L] + segment + a[R + 1:]
	if all((mapped_a[i] <= mapped_a[i + 1] for i in range(n))):
		print('yes')
		print(L, R)
	else:
		print('no')
elif not (L and R):
	print('yes')
	print(1, 1)
else:
	print('no')


size = int(input())
valores = [int(valor) for valor in input().split()]
index = []
for i in range(len(valores) - 1):
	if valores[i] > valores[i + 1]:
		index.append(i)
		index.append(i + 1)
		aux = i + 1
		j = i + 2
		if j >= len(valores):
			break
		while j < len(valores):
			if valores[j] < valores[aux]:
				index.append(j)
				j += 1
				aux += 1
			else:
				break
		break
for i in range(len(index) // 2):
	aux = valores[index[i]]
	valores[index[i]] = valores[index[len(index) - 1 - i]]
	valores[index[len(index) - 1 - i]] = aux
aux = [valor for valor in valores]
aux.sort()
if aux == valores:
	print('yes')
	if len(index) == 0:
		print('1 1')
	else:
		print('{} {}'.format(index[0] + 1, index[-1] + 1))
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
mimax = a[0]
f = 0
l = r = 0
q = 0
for i in range(1, n):
	if a[i] >= a[i - 1] and f == 0:
		mimax = a[i]
	elif f == 0:
		l = i
		f += 1
	if a[i] <= a[i - 1] and f == 1:
		pass
	elif f == 1:
		f += 1
		r = i
		if a[i] < mimax:
			q = 1
			break
	if f == 2 and a[i] < a[i - 1]:
		q = 1
		break
if q == 1:
	print('no')
elif f == 0:
	print('yes')
	print(1, 1)
elif f == 1:
	if l > 1:
		if a[l - 2] > a[r - 1]:
			print('no')
		else:
			print('yes')
			print(l, n)
	else:
		print('yes')
		print(l, n)
elif f == 2:
	print('yes')
	print(l, r)


size = int(input())
arr = list(map(int, input().split()))
sorted_arr = sorted(arr)
left = right = 0
for i in range(size):
	if arr[i] != sorted_arr[i]:
		left = i
		break
for j in range(size - 1, -1, -1):
	if arr[j] != sorted_arr[j]:
		right = j
		break
(i, j) = (left, right)
while i < j:
	(arr[i], arr[j]) = (arr[j], arr[i])
	i += 1
	j -= 1
if arr == sorted_arr:
	print('yes')
	print('{} {}'.format(left + 1, right + 1))
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b.sort()
if a == b:
	print('yes')
	print('1 1')
	exit()
i = 0
l = 0
flag = 0
r = 0
while i < n:
	if i != 0:
		if a[i] < a[i - 1] and flag == 0:
			l = i - 1
			flag = 1
		if a[i] > a[i - 1] and flag == 1:
			r = i
			flag = 0
	i += 1
if r == 0:
	r = n
a[l:r] = reversed(a[l:r])
if a == b:
	print('yes')
	print(l + 1, r)
else:
	print('no')


def main():
	n = int(input().strip())
	aa = list(map(int, input().strip().split()))
	curdir = True
	a = -1
	l = []
	for (i, b) in enumerate(aa):
		if curdir != (a < b):
			l.append(i)
			if len(l) == 2:
				break
			curdir ^= True
		a = b
	if not l:
		print('yes')
		print(1, 1)
		return
	if len(l) == 1:
		(i, j) = (l[0], len(aa))
		if i > 1:
			aa[i - 1:] = aa[:i - 2:-1]
		else:
			aa.reverse()
	else:
		(i, j) = l
		aa[i - 1:j] = aa[j - 1:i - 2:-1] if i > 1 else aa[j - 1::-1]
	a = -1
	for b in aa:
		if a > b:
			print('no')
			break
		a = b
	else:
		print('yes')
		print(min(i, j), max(i, j))
main()


from sys import stdin, stdout
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
valid = True
for i in range(1, n):
	if a[i] < a[i - 1]:
		valid = False
		break
if not valid:
	(start, end) = (0, n - 1)
	for i in range(1, n):
		if a[i] < a[i - 1]:
			start = i - 1
			break
	for i in range(n - 2, -1, -1):
		if a[i] > a[i + 1]:
			end = i + 1
			break
	A = []
	for i in range(start):
		A.append(a[i])
	for i in range(end, start - 1, -1):
		A.append(a[i])
	for i in range(end + 1, n):
		A.append(a[i])
	valid = True
	for i in range(1, n):
		if A[i] < A[i - 1]:
			valid = False
			break
	if not valid:
		stdout.write('no\n')
	else:
		stdout.write('yes\n{} {}\n'.format(start + 1, end + 1))
else:
	stdout.write('yes\n1 1')


n = int(input())
arr = list(map(int, input().split()))
inSegment = False
start = 0
end = 0
answer = 'yes'
for i in range(1, n, 1):
	if arr[i] < arr[i - 1] and (not inSegment):
		start = i - 1
		inSegment = True
	if arr[i] > arr[i - 1] and inSegment:
		end = i - 1
		break
	if i == n - 1 and inSegment:
		end = n - 1
arr[start:end + 1] = sorted(arr[start:end + 1])
for i in range(1, n, 1):
	if arr[i] < arr[i - 1]:
		answer = 'no'
		break
print(answer)
if answer == 'yes':
	print(start + 1, end + 1)


from sys import exit
n = input()
inp = input().split(' ')
orig = list(map(int, inp))
sor = list(map(int, inp))
sor = sorted(orig)
if len(orig) == 2 and orig[0] < orig[1]:
	print('yes')
	print('1 1')
	exit(0)
elif len(orig) == 2 and orig[0] > orig[1]:
	print('yes')
	print('1 2')
	exit(0)
start = 0
while orig[start] == sor[start]:
	start = start + 1
	if start >= len(orig):
		break
rev = len(orig) - 1
while orig[rev] == sor[rev]:
	rev = rev - 1
	if rev < 0:
		break
orig[start:rev + 1] = orig[start:rev + 1][::-1]
if start == len(orig):
	print('yes')
	print('1 1')
	exit(0)
if orig == sor:
	print('yes')
	print(start + 1, rev + 1)
else:
	print('no')


n = int(input())
a = [int(x) for x in input().split()]
b = sorted(a)
if a == b:
	print('yes')
	print(1, 1)
else:
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			break
	j = n - 1
	while j > 0:
		if a[j] < a[j - 1]:
			break
		j -= 1
	t = a[i:j + 1][::-1]
	a = a[:i] + t + a[j + 1:]
	if a == b:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
ar = [int(i) for i in input().split()]
goal = sorted(ar)
for i in range(n - 1):
	if ar[i + 1] < ar[i]:
		for j in range(i + 1, n - 1):
			if ar[j + 1] > ar[j]:
				ar[i:j + 1] = reversed(ar[i:j + 1])
				if ar == goal:
					print('yes')
					print('%d %d' % (i + 1, j + 1))
				else:
					print('no')
				quit()
		ar[i:] = reversed(ar[i:])
		if ar == goal:
			print('yes')
			print('%d %d' % (i + 1, n))
		else:
			print('no')
		quit()
print('yes')
print('1 1')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
mark1 = mark2 = 0
for i in range(n):
	if a[i] != b[i]:
		mark1 = i
		break
for i in range(n):
	if a[n - i - 1] != b[n - i - 1]:
		mark2 = n - i - 1
		break
z = a[mark1:mark2 + 1]
z = z[::-1]
b = b[mark1:mark2 + 1]
if b == z:
	print('yes')
	print(mark1 + 1, mark2 + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
f = 0
for i in range(n - 1):
	if a[i] > a[i + 1]:
		f = 1
		x = i
		break
if f == 0:
	print('yes')
	print(1, 1)
else:
	for i in range(x + 1, n):
		if a[i] <= a[i - 1]:
			y = i
	a1 = a[:x] + a[x:y + 1][::-1] + a[y + 1:]
	a.sort()
	if a1 == a:
		print('yes')
		print(x + 1, y + 1)
	else:
		print('no')


def find(l):
	for i in range(1, len(l)):
		if l[i] < l[i - 1]:
			return False
	return True
n = int(input())
l = list(map(int, input().split()))
if find(l):
	print('yes')
	print(1, 1)
else:
	i = 1
	t = 0
	(a, b) = (0, 0)
	while i < n:
		if l[i - 1] > l[i]:
			if t == 0:
				t = 1
				a = i - 1
		elif t == 1:
			t = 0
			b = i
			break
		i += 1
	if t == 1:
		b = n
	l[a:b] = l[a:b][::-1]
	if not find(l):
		print('no')
	else:
		print('yes')
		print(a + 1, b)


n = int(input())
array = [int(x) for x in input().split(' ')]
min_edge = 0
max_edge = 10000000000
start = end = -1
in_rotation = False
already_rotated = False
not_found = False
for i in range(n):
	if already_rotated:
		if i + 1 < n and array[i] > array[i + 1]:
			not_found = True
			break
	else:
		if i + 1 < n and (not in_rotation) and (array[i] > array[i + 1]):
			start = i
			min_edge = 0 if i - 1 < 0 else array[i - 1]
			in_rotation = True
		if i + 1 < n and in_rotation and (array[i] < array[i + 1]):
			end = i
			max_edge = array[i + 1]
			if array[start] > max_edge or array[end] < min_edge:
				not_found = True
				break
			already_rotated = True
if not_found:
	print('no')
elif start == end and start == -1:
	print('yes\n1 1')
else:
	if not already_rotated:
		end = n - 1
	if array[start] > max_edge or array[end] < min_edge:
		print('no')
	else:
		print('yes\n{} {}'.format(start + 1, end + 1))


def main():
	n = int(input())
	a = list(map(int, input().split()))
	j = -1
	for i in range(1, n):
		if a[i] < a[i - 1]:
			j = i - 1
			break
	if j == -1:
		print('yes')
		print('1 1')
	else:
		k = j
		while j < n - 1:
			if a[j] < a[j + 1]:
				break
			j += 1
		c = k
		b = j
		while k < j:
			(a[k], a[j]) = (a[j], a[k])
			k += 1
			j -= 1
		flag = True
		for i in range(n - 1):
			if a[i] > a[i + 1]:
				flag = False
				break
		if flag:
			print('yes')
			print(c + 1, b + 1)
		else:
			print('no')
main()


n = int(input(''))
x = list(map(int, input().split()))
k = []
c = 0
if x == sorted(x):
	print('yes')
	print(1, 1)
else:
	for i in range(0, len(x) - 1):
		if x[i] > x[i + 1]:
			k.append(x[i])
			c = i
	k.append(x[c + 1])
	b = k[::-1]
	start_idx = c + 2 - len(b)
	end_idx = c + 1
	y = x[:start_idx] + b + x[end_idx + 1:]
	if y == sorted(y):
		print('yes')
		print(start_idx + 1, end_idx + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
l1 = sorted(l)
strt = 0
last = 0
for i in range(n):
	if l1[i] != l[i]:
		strt = i
		break
for i in range(n - 1, -1, -1):
	if l1[i] != l[i]:
		last = i
		break
seg = l[strt:last + 1]
seg.reverse()
if last < n:
	if l[:strt] + seg + l[last + 1:] == sorted(l):
		print('yes')
		print(strt + 1, last + 1)
	else:
		print('no')
elif l[:strt] + seg == sorted(l):
	print('yes')
	print(strt + 1, last + 1)
else:
	print('no')


import sys
n = int(sys.stdin.readline())
a = list(map(lambda s: int(s), sys.stdin.readline().split()))

def is_sorted(l):
	sorted = True
	for i in range(1, n):
		if l[i] < l[i - 1]:
			sorted = False
	return sorted
if is_sorted(a):
	print('yes')
	print('1 1')
	sys.exit(0)
first = 0
second = n - 1
if a[1] < a[0]:
	first = 0
else:
	for i in range(1, n):
		if a[i] < a[i - 1]:
			first = i - 1
			break
for i in range(first + 1, n):
	if a[i] > a[i - 1]:
		second = i - 1
		break
for i in range((second - first + 1) // 2):
	x = a[first + i]
	a[first + i] = a[second - i]
	a[second - i] = x
if is_sorted(a):
	print('yes')
	print(first + 1, second + 1)
else:
	print('no')


x = int(input())
y = list(map(int, input().split()))
jk = y[:]
ans = []
lmao = 0
for i in range(x - 1):
	if y[i] >= y[i + 1]:
		if lmao == 0:
			ans.append(y[i])
			ans.append(y[i + 1])
		else:
			ans.append(y[i + 1])
			lmao += 1
jk.sort()
if len(ans) >= 2:
	if jk == y[:y.index(ans[0])] + list(reversed(y[y.index(ans[0]):y.index(ans[len(ans) - 1]) + 1])) + y[y.index(ans[len(ans) - 1]) + 1:]:
		print('yes')
		print(y.index(ans[0]) + 1, y.index(ans[len(ans) - 1]) + 1)
	else:
		print('no')
elif y == jk:
	print('yes')
	print('1', '1')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
l = -1
r = -1
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		r = i
		break
c = a[l:r + 1]
c.reverse()
a[l:r + 1] = c
for i in range(n):
	if a[i] != b[i]:
		print('no')
		exit()
if l == -1 and r == -1:
	l = 0
	r = 0
print('yes')
print(l + 1, r + 1)


t = int(input())
a = list(map(int, input().split()))
flag = 0
f = 0
for i in range(t - 1):
	if a[i] > a[i + 1]:
		f = 1
		break
if f == 0:
	print('yes')
	print(1, 1)
else:
	ind = -1
	ind1 = -1
	flag = 0
	for i in range(t - 1):
		if a[i] > a[i + 1] and flag == 0:
			ind = i
			flag = 1
		elif flag == 1:
			if a[i] < a[i + 1]:
				a[ind:i + 1] = reversed(a[ind:i + 1])
				ind1 = i + 1
				break
	if ind1 == -1:
		a[ind:] = reversed(a[ind:])
		ind1 = t
	val = 0
	for i in range(t - 1):
		if a[i] > a[i + 1]:
			val = 1
			break
	if val == 1:
		print('no')
	else:
		print('yes')
		print(ind + 1, ind1)


n = int(input())
a = list(map(int, input().split()))
b = a[:]
b.sort()
(first, second) = (-1, -1)
for i in range(n):
	if a[i] != b[i]:
		if first == -1:
			first = i
			break
for i in range(n - 1, 0, -1):
	if a[i] != b[i]:
		if second == -1:
			second = i
			break
if first == -1:
	print('yes')
	print(1, 1)
else:
	d = a[first:second + 1]
	d.reverse()
	c = a[:first] + d + a[second + 1:]
	for i in range(1, n):
		if c[i] < c[i - 1]:
			print('no')
			break
	else:
		print('yes')
		print(first + 1, second + 1)


n = int(input())
l = [int(x) for x in input().split()]
m = l[0:]
m.sort()
mp = {}
for i in range(n):
	mp[m[i]] = i
for i in range(n):
	l[i] = mp[l[i]]
left = -1
for i in range(n):
	if l[i] != i:
		left = i
		break
right = -1
for i in range(n - 1, -1, -1):
	if l[i] != i:
		right = i
		break
if left == -1 and right == -1:
	print('yes')
	print(1, 1)
else:
	new_l = l[left:right + 1]
	new_l.reverse()
	l[left:right + 1] = new_l
	stat = True
	for i in range(n):
		if l[i] != i:
			stat = False
			break
	if stat == False:
		print('no')
	else:
		print('yes')
		print(left + 1, right + 1)


n = int(input())
a = list(map(int, input().split()))
a.insert(0, 0)
if n == 1:
	print('yes')
	print(1, 1)
	exit()
for i in range(1, n):
	if a[i] < a[i + 1]:
		if i == n - 1:
			print('yes')
			print(1, 1)
			exit()
	else:
		break
for j in range(i, n):
	if a[j] > a[j + 1]:
		if j == n - 1 and a[i - 1] < a[j + 1]:
			print('yes')
			print(i, n)
			exit()
	else:
		break
if a[i - 1] > a[j] or a[i] > a[j + 1]:
	print('no')
	exit()
for k in range(j, n):
	if a[k] < a[k + 1]:
		if k == n - 1:
			print('yes')
			print(i, j)
			exit()
	else:
		print('no')
		exit()


def solve(arr):
	n = len(arr)
	seq = set()
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			seq.add(i)
			seq.add(i + 1)
	l = sorted(list(seq))
	if len(l) == 0:
		return (1, 1)
	t = arr[:l[0]] + list(reversed(arr[l[0]:l[-1] + 1])) + arr[l[-1] + 1:]
	if t != sorted(arr):
		return None
	return (l[0] + 1, l[-1] + 1)

def test():
	p = lambda st: list(map(int, st.split()))
	assert solve(p('3 2 1')) == (1, 3)
	assert solve(p('2 1 3 4')) == (1, 2)
	assert solve(p('3 1 2 4')) == None
	assert solve(p('1 2')) == (1, 1)
	assert solve(p('1 5 3 4 2 6')) == None
test()
input()
res = solve(list(map(int, input().split())))
if res is None:
	print('no')
else:
	print('yes\n{} {}'.format(res[0], res[1]))


a = int(input())
b = input().split(' ')
c = []
d = 0
e = 0
f = 0
for i in range(0, a, 1):
	b[i] = int(b[i])
c = sorted(b)
i = 0
while i < a:
	if b[i] != c[i]:
		f += 1
		j = c[i]
		if f == 2:
			break
		if d == 0:
			d = i
		while b[i] != j:
			i += 1
			if i == a:
				break
		if e == 0:
			e = i
	i += 1
if f > 1:
	print('no')
elif f == 0:
	print('yes')
	print('1 1')
else:
	j = e
	f = 0
	for i in range(d, e + 1, 1):
		if b[i] != c[j]:
			f += 1
			break
		j -= 1
	if f == 0:
		print('yes')
		print(d + 1, e + 1)
	else:
		print('no')


n = int(input())

def solve():
	ls = list(map(int, input().split()))
	dec = []
	fin = False
	for i in range(n - 1):
		if ls[i + 1] < ls[i]:
			if dec and dec[-1] != i - 1:
				return (False, -1)
			else:
				dec.append(i)
		else:
			fin = True
	if not dec:
		return (True, 1, 1)
	dec.append(dec[-1] + 1)
	if dec[-1] + 1 < n and ls[dec[0]] > ls[dec[-1] + 1] or (dec[0] - 1 >= 0 and ls[dec[-1]] < ls[dec[0] - 1]):
		return (False, -1)
	return (True, dec[0] + 1, dec[-1] + 1)
ans = solve()
if ans[0]:
	print('yes')
	print(ans[1], ans[2])
else:
	print('no')


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	sorted_arr = sorted(arr)
	search_val = None
	begin_index = -1
	for i in range(n):
		if arr[i] != sorted_arr[i]:
			begin_index = i
			search_val = arr[i]
			break
	if search_val is None:
		print('yes')
		print(1, 1)
		return
	end_index = sorted_arr.index(search_val)
	i = begin_index
	j = end_index
	while i < j:
		(arr[i], arr[j]) = (arr[j], arr[i])
		i += 1
		j -= 1
	if arr == sorted_arr:
		print('yes')
		print(begin_index + 1, end_index + 1)
	else:
		print('no')
main()


n = int(input())
ls = list(map(int, input().split()))
sorted_ls = sorted(ls)
ind = 0
flag = True
l = 0
r = 0
new_ls = []
for i in range(n):
	new_ls.append(ls[i])
for i in range(n):
	if sorted_ls[i] != ls[i]:
		ind = ls.index(sorted_ls[i])
		m = i
		k = ind
		l = i
		r = ind
		while m <= ind:
			if sorted_ls[m] == ls[k]:
				new_ls[m] = sorted_ls[m]
				m += 1
				k -= 1
			else:
				flag = False
				break
		break
for i in range(n):
	if new_ls[i] - sorted_ls[i] != 0:
		flag = False
		break
if flag:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
A = [int(x) for x in input().split()]
B = [A[i] for i in range(n)]
B.sort()
(a, b) = (-1, -1)
for i in range(1, n):
	if A[i] < A[i - 1]:
		a = i - 1
		break
if a == -1:
	print('yes')
	print(1, 1)
else:
	for i in range(a + 1, n):
		if A[i] > A[i - 1]:
			b = i - 1
			break
	if b == -1 and A[:a] == B[:a]:
		print('yes')
		print(a + 1, n)
	elif A[:a] == B[:a] and A[b + 1:] == B[b + 1:]:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


n = int(input())
ls = [int(u) for u in input().split()]
ls1 = ls.copy()
ls1.sort()
cond = True
for i in range(len(ls)):
	if ls[i] != ls1[i]:
		cond = False
		break
if cond == True:
	print('yes')
	print('1 1')
	exit(0)
for i in range(len(ls)):
	if ls[i] != ls1[i]:
		start_index = i
		break
for i in range(len(ls)):
	if ls[len(ls) - 1 - i] != ls1[len(ls) - 1 - i]:
		end_index = len(ls) - 1 - i
		break
ls_sorted = []
for i in range(0, start_index):
	ls_sorted.append(ls[i])
for i in range(end_index, start_index - 1, -1):
	ls_sorted.append(ls[i])
for i in range(end_index + 1, len(ls)):
	ls_sorted.append(ls[i])
cond = True
for i in range(len(ls)):
	if ls_sorted[i] != ls1[i]:
		cond = False
		break
if cond == True:
	print('yes')
	print(1 + start_index, 1 + end_index)
else:
	print('no\n')


class Solution:

	def sortTheArray(self, n, nums):
		sortedNums = sorted(nums)
		if sortedNums == nums:
			return [1, 1]
		leftPos = 0
		rightPos = n - 1
		while leftPos < n - 1:
			if nums[leftPos] < nums[leftPos + 1]:
				leftPos += 1
			else:
				break
		while rightPos > 1:
			if nums[rightPos] > nums[rightPos - 1]:
				rightPos -= 1
			else:
				break
		newReverse = nums[:leftPos] + nums[leftPos:rightPos + 1][::-1] + nums[rightPos + 1:]
		if sortedNums == newReverse:
			return [leftPos + 1, rightPos + 1]
		return -1
n = int(input())
nums = list(map(int, input().split()))
solution = Solution()
result = solution.sortTheArray(n, nums)
if result != -1:
	print('yes')
	print('{} {}'.format(result[0], result[1]))
else:
	print('no')


a = input()
a = list(map(int, input().split()))
b = sorted(a)
c = []
pDif1 = 0
pDif2 = 0
for i in range(len(a)):
	if a[i] != b[i]:
		pDif1 = i
		break
for i in range(len(a) - 1, -1, -1):
	if a[i] != b[i]:
		pDif2 = i
		break
for i in range(pDif1):
	c += a[i:i + 1]
for i in range(pDif2, pDif1 - 1, -1):
	c += a[i:i + 1]
for i in range(pDif2 + 1, len(a)):
	c += a[i:i + 1]
if b == c:
	print('yes')
	print('{0} {1}'.format(pDif1 + 1, pDif2 + 1))
else:
	print('no')


def main():
	input()
	array = list(map(int, input().split()))
	(left, right) = (-1, len(array) - 1)
	for i in range(len(array) - 1):
		if array[i] > array[i + 1] and left < 0:
			left = i
		if array[i] <= array[i + 1] and left >= 0:
			right = i
			break
	(l, m, r) = (array[:left], array[left:right + 1], array[right + 1:])
	if left >= 0:
		m.reverse()
	array = l + m + r
	for i in range(len(array) - 1):
		if array[i] > array[i + 1]:
			print('no')
			return
	if left < 0:
		(left, right) = (0, 0)
	print('yes')
	print(' '.join(map(str, [left + 1, right + 1])))
main()


n = int(input())
num = list(map(int, input().split()))
(L, R) = (-1, -1)
for i in range(1, len(num)):
	if num[i - 1] > num[i]:
		L = i
		break
if L != -1:
	for i in range(L, n):
		if num[i - 1] < num[i]:
			R = i
			break
	if L == 1 and R == -1:
		print('yes')
		print(1, n)
	else:
		if R == -1:
			R = n
		a = num[L - 1:R]
		a.reverse()
		new = num[:L - 1] + a + num[R:]
		t = new[:]
		t.sort()
		if t == new:
			print('yes')
			print(L, R)
		else:
			print('no')
else:
	print('yes')
	print(1, 1)


def is_sorted(a):
	flag = 1
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			flag = 0
			break
	return flag
n = int(input())
inp = input()
a = [int(x) for x in inp.split()]
if is_sorted(a) == 1:
	print('yes')
	print(1, 1)
else:
	l = 0
	r = n - 1
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			l = i
			break
	j = l
	while a[l] == a[j]:
		j -= 1
	l = j + 1
	for i in range(l + 1, n - 1):
		if a[i] < a[i + 1]:
			r = i
			break
	a[l:r + 1] = a[l:r + 1][::-1]
	if is_sorted(a) == 1:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


def lo(a):
	(lds, current) = ([], [a[0]])
	for val in a[1:]:
		if val < current[-1]:
			current.append(val)
		else:
			lds = current[:] if len(current) > len(lds) else lds
			current = [val]
	lds = current[:] if len(current) > len(lds) else lds
	return lds
n = int(input())
a = list(map(int, input().split()))
b = list(a)
b.sort()
pat = lo(a)
for i in range(n):
	if a[i] == pat[0] and a[i:i + len(pat)] == pat:
		a[i:i + len(pat)] = pat[::-1]
		break
if a == b:
	print('yes')
	print(i + 1, i + len(pat))
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
if a == b:
	print('yes\n1 1')
	exit()
(I, J) = (-1, -1)
for i in range(n):
	if a[i] != b[i]:
		if I == -1:
			I = i
		else:
			J = i
a[I:J + 1] = a[I:J + 1][::-1]
if a == b:
	print('yes\n{} {}'.format(I + 1, J + 1))
else:
	print('no')


n = int(input())
l = list(map(int, input().split()))
ascend = sorted(l)
newl = [(l[i], ascend[i]) for i in range(n) if l[i] != ascend[i]]
if len(newl) == 0:
	print('yes')
	print(1, 1)
else:
	subl = l[l.index(newl[0][0]):l.index(newl[-1][0]) + 1]
	if list(reversed(subl)) == ascend[ascend.index(newl[0][1]):ascend.index(newl[-1][1]) + 1]:
		print('yes')
		print(l.index(newl[0][0]) + 1, l.index(newl[-1][0]) + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
a = -1
b = -1
for i in range(n - 1):
	if a == -1:
		if l[i] > l[i + 1]:
			a = i
	elif b == -1:
		if l[i] < l[i + 1]:
			b = i
	else:
		break
if a == -1 and b == -1:
	print('yes')
	print(1, 1)
else:
	if b == -1:
		b = n - 1
	r = l[a:b + 1]
	r.reverse()
	x = l[:a]
	y = l[b + 1:]
	p = []
	p.extend(x)
	p.extend(r)
	p.extend(y)
	l.sort()
	if p == l:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


n = int(input())
a = [int(i) for i in input().split()]
start = -1
end = -1
for i in range(n - 1):
	if start == -1 and a[i] > a[i + 1]:
		start = i
		end = i + 1
	elif a[i] > a[i + 1]:
		end = i + 1
a = a[:start] + a[start:end + 1][::-1] + a[end + 1:]
if start == -1:
	print('yes')
	print(1, 1)
elif a == sorted(a):
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
arr = list(map(int, input().split()))
f = 0
for i in range(0, n - 1):
	if arr[i] > arr[i + 1]:
		f = 1
if f == 0:
	print('yes')
	print(1, 1)
else:
	start = 0
	end = n - 1
	for i in range(0, n - 1):
		if arr[i] > arr[i + 1]:
			start = i
			break
	for i in range(n - 1, -1, -1):
		if arr[i] < arr[i - 1]:
			end = i
			break
	final = []
	for i in range(0, start):
		final.append(arr[i])
	for i in range(end, start - 1, -1):
		final.append(arr[i])
	for i in range(end + 1, n):
		final.append(arr[i])
	f = 0
	for i in range(0, n - 1):
		if final[i] > final[i + 1]:
			f = 1
			break
	if f == 1:
		print('no')
	else:
		print('yes')
		print(start + 1, end + 1)


n = int(input())
l = [int(x) for x in input().split()]
l.append(9999999999999999)
k = []
prev = 0
a = 1
b = 1
flag = 1
for i in range(0, n):
	if l[i + 1] - l[i] >= 0:
		if prev == 1:
			prev = 2
	elif prev == 0:
		a = i + 1
		b = i + 2
		prev = 1
	elif prev == 1:
		b += 1
	else:
		flag = 0
if flag:
	if b < n:
		if l[b] >= l[a - 1]:
			print('yes')
			print(a, b)
		else:
			print('no')
	elif a > 1:
		if l[a - 2] <= l[b - 1]:
			print('yes')
			print(a, b)
		else:
			print('no')
	else:
		print('yes')
		print(a, b)
else:
	print('no')


n = int(input())
a = [int(i) for i in input().split()]
b = a[:]
b.sort()
if a == b:
	print('yes')
	print('1 1')
else:
	pre = a[0]
	(s, e) = (0, 0)
	for i in range(1, n):
		if pre > a[i]:
			s = i - 1
			break
		pre = a[i]
	pre = a[s]
	for i in range(s + 1, n):
		if pre < a[i]:
			e = i - 1
			break
		pre = a[i]
	if e == 0:
		e = n - 1
	a = a[:s] + a[s:e + 1][::-1] + a[e + 1:]
	if a == b:
		print('yes')
		s += 1
		e += 1
		print(s, end=' ')
		print(e)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
if len(a) > 1:
	dec = a[0] > a[1]
	dec_count = 0
	if dec:
		dec_count += 1
		dec_start = 0
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			if dec:
				continue
			else:
				dec = True
				dec_start = i
				dec_count += 1
				if dec_count > 1:
					break
		elif dec:
			dec = False
			dec_end = i
			if a[dec_start] > a[i + 1]:
				dec_count += 1
			if dec_start > 0 and a[dec_end] < a[dec_start - 1]:
				dec_count += 1
		else:
			continue
	if dec:
		dec_end = n - 1
		if dec_start > 0 and a[dec_end] < a[dec_start - 1]:
			dec_count += 1
	if dec_count == 0:
		print('yes')
		print('1 1')
	elif dec_count == 1:
		print('yes')
		print(str(dec_start + 1) + ' ' + str(dec_end + 1))
	else:
		print('no')
else:
	print('yes')
	print('1 1')


int(input())
arr = input().split(' ')
arr = [-1] + arr
p = -1
state = 0
start = None
end = None
for (i, c) in enumerate(arr):
	c = int(c)
	if c < p and start is None:
		if state == 0:
			state = 1
			start = i - 1
	elif c > p and state == 1:
		state = 2
		end = i - 1
		if int(arr[start]) > c:
			state = 3
			break
		if int(arr[end]) < int(arr[start - 1]):
			state = 3
			break
	elif c < p and state == 2:
		state = 3
		break
	p = int(c)
if state == 1:
	end = len(arr) - 1
	if int(arr[end]) < int(arr[start - 1]):
		state = 3
elif state == 0:
	start = end = 1
if state == 3:
	print('no')
else:
	print('yes')
	print(start, end)


n = int(input())
l1 = list(map(int, input().split()))
flag = 0
l2 = l1.copy()
l2.sort()
for i in range(n):
	if l1[i] != l2[i]:
		flag = 1
		break
if flag == 0:
	print('yes')
	print(1, 1)
else:
	for j in range(n - 1, i - 1, -1):
		if l1[j] != l2[j]:
			break
	l1 = l1[:i] + list(reversed(l1[i:j + 1])) + l1[j + 1:]
	if l1 == l2:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
m = sorted(l)
i = 0
while i < n and i > -1 and (l[i] == m[i]):
	i = i + 1
if i == n:
	print('yes')
	print('{0} {0}'.format(1, 1))
else:
	j = n - 1
	while l[j] == m[j]:
		j = j - 1
	jj = j
	ii = i
	while i < n and j > -1 and (m[i] == l[j]):
		i = i + 1
		j = j - 1
	if ii - 1 == j:
		print('yes')
		print('{0} {1}'.format(ii + 1, jj + 1))
	else:
		print('no')


n = int(input())
l = [int(x) for x in input().split()]
(start, end) = (-1, -1)
flag = 0
(i, j, k) = (0, 0, 0)
for i in range(len(l) - 1):
	if l[i + 1] < l[i]:
		start = l[i]
		break
for j in range(i + 1, len(l)):
	if l[j] > start:
		end = l[j - 1]
		break
	elif j == len(l) - 1:
		end = l[j]
		flag = 1
		break
if i == len(l) - 2 and start == -1 or len(l) == 1:
	print('yes')
	print(1, 1)
elif start != -1 and end != -1:
	if flag == 1:
		l = l[:i] + l[i:j + 1][::-1]
	else:
		l = l[:i] + l[i:j][::-1] + l[j:]
	for k in range(len(l) - 1):
		if l[k + 1] < l[k]:
			print('no')
			break
	if k == len(l) - 2 and l[k + 1] > l[k]:
		if flag == 1:
			print('yes')
			print(i + 1, j + 1)
		else:
			print('yes')
			print(i + 1, j)
else:
	print('no')


n = int(input())
A = [0] + [int(x) for x in input().split()]
B = A[:]
B.sort()
if A == B:
	print('yes')
	print(1, 1)
	exit()
elif A[n:0:-1] == B[1:]:
	print('yes')
	print(1, n)
	exit()
Start = -1
End = -1
i = 1
Skip = 1
while i < n + 1:
	if A[i] != B[i]:
		Start = i
		while i < n + 1 and A[i] != B[i]:
			i += 1
		End = i - 1
		if Skip:
			Skip = 0
			i += 1
			while i < n + 1 and A[i] != B[i]:
				i += 1
				Skip = 1
			if Skip:
				End = i - 1
		break
	else:
		i += 1
A = A[:Start] + A[End:Start - 1:-1] + A[End + 1:]
if A == B:
	print('yes')
	print(Start, End)
else:
	print('no')


def process(a, n):
	reverse = []
	b = sorted(a)
	for i in range(n):
		if a[i] != b[i]:
			reverse.append(i)
	if len(reverse) == 0:
		print('yes')
		print(1, 1)
	else:
		c = a[:]
		t = 0
		for i in range(reverse[0], reverse[-1] + 1):
			c[i] = a[reverse[-1] - t]
			t += 1
		for i in range(n):
			if c[i] != b[i]:
				print('no')
				return
		print('yes')
		print(reverse[0] + 1, reverse[-1] + 1)
n = int(input())
a = list(map(int, input().split()))
process(a, n)


n = int(input())
a = list(map(int, input().split()))
start = end = 0
for i in range(n - 1):
	if a[i] > a[i + 1]:
		start = i
		break
i = start
while i < n - 1 and a[i] > a[i + 1]:
	i += 1
end = i
b = a[:start] + a[start:end + 1][::-1] + a[end + 1:]
a.sort()
if a == b:
	print('yes')
	print(start + 1, end + 1)
	exit(0)
print('no')


n = int(input())
l1 = list(map(int, input().split()))
l2 = sorted(l1)
l = -1
r = -1
for i in range(n):
	if l1[i] != l2[i]:
		l = i
		break
for e in range(n - 1, 0, -1):
	if l1[e] != l2[e]:
		r = e
		break
seg = l1[l:r + 1]
seg.reverse()
new = l1[0:l] + seg + l2[r + 1:]
if l == -1 and r == -1:
	print('yes')
	print(1, 1)
elif new == l2:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


def main():
	n = int(input())
	a = map(int, input().split())
	a = [e[1] for e in sorted(zip(a, range(1, n + 1)))]
	i = 1
	while i - 1 < n and a[i - 1] == i:
		i += 1
	if i > n:
		print('yes')
		print(1, 1)
		return
	idx = a.index(i) + 1
	a[i - 1:idx] = a[i - 1:idx][::-1]
	if a == list(range(1, len(a) + 1)):
		print('yes')
		print(i, idx)
	else:
		print('no')
main()


n = int(input())
arr = list(map(int, input().split()))
arr2 = []
arr2 = sorted(arr)
f = 0
l = 0
for i in range(n):
	if arr[i] != arr2[i]:
		f = i
		break
for i in range(n - 1, -1, -1):
	if arr[i] != arr2[i]:
		l = i
		break
i = f
j = l
while i < j:
	(arr[i], arr[j]) = (arr[j], arr[i])
	i += 1
	j -= 1
for i in range(n):
	if arr[i] != arr2[i]:
		print('no')
		exit()
print('yes')
print(f + 1, l + 1)


p = c = 0
l = []
n = int(input())
a = list(map(int, input().split()))
for i in range(n - 1):
	if a[i + 1] <= a[i]:
		if c == 0:
			p = i
		c = 1
		l.append(a[i])
	elif c == 1 and a[i + 1] > a[i]:
		l.append(a[i])
		break
	if i == n - 2 and a[i + 1] <= a[i]:
		l.append(a[n - 1])
l = l[::-1]
a = a[:p] + l + a[p + len(l):]

def fn(a, n, l, p):
	for i in range(n - 1):
		if a[i + 1] < a[i]:
			return 'no'
	if len(l) > 0:
		return 'yes\n' + str(p + 1) + ' ' + str(p + len(l))
	return 'yes\n' + '1 ' + '1'
print(fn(a, n, l, p))


n = int(input())
a = list(map(int, input().split()))
b = []
b = sorted(a)
for i in range(n):
	if a[i] != b[i]:
		break
for j in range(n - 1, -1, -1):
	if a[j] != b[j]:
		break
if i > j:
	print('yes')
	print('1', '1')
else:
	f = 0
	for k in range(i + 1, j + 1):
		if a[k] > a[k - 1]:
			f = 1
			break
	if f == 0:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
if sorted(a) == a:
	print('yes')
	print('1 1')
	exit()
start = 0
end = n - 1
seen = 0
for i in range(n - 1):
	if not seen:
		if a[i] > a[i + 1]:
			seen += 1
			start = i
	elif a[i] <= a[i + 1]:
		end = i
		break
a = a[:start] + a[start:end + 1][::-1] + a[end + 1:]
if sorted(a) == a:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
c = []
b = []
for i in range(n - 1):
	if a[i] > a[i + 1]:
		c.append(i)
		if i == n - 2:
			c.append(n - 1)
	elif len(c) != 0:
		c.append(i)
		break
if len(c) == 0:
	print('yes')
	print('1 1')
	exit()
b = b + a[0:c[0]]
for i in range(c[-1], c[0] - 1, -1):
	b.append(a[i])
b = b + a[c[-1] + 1:]
for i in range(n - 1):
	if b[i] > b[i + 1]:
		print('no')
		exit()
print('yes')
print(c[0] + 1, c[-1] + 1)


n = int(input())
a = list(map(int, input().split()))
a1 = sorted(a)
flag = 0
f1 = 0
if sorted(a) == a[::-1]:
	print('yes')
	print('1', end=' ')
	print(n)
elif a == sorted(a):
	print('yes')
	print('1 1')
else:
	l = -1
	r = -1
	for i in range(n - 1):
		if a[i] > a[i + 1] and flag == 0:
			l = i
			flag = 1
		if a[i] < a[i + 1] and flag == 1 and (f1 == 0):
			r = i
			f1 = 1
	if l >= 0 and r == -1:
		r = n - 1
	l1 = a[l:r + 1]
	l1.sort()
	f = 0
	for i in range(l, r + 1):
		a[i] = l1[i - l]
	if a == sorted(a):
		print('yes')
		print(l + 1, end=' ')
		print(r + 1)
	else:
		print('no')


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
n = ini()
a = inl()
if a == sorted(a):
	print('yes')
	print(1, 1)
elif a == sorted(a, reverse=True):
	print('yes')
	print(1, n)
else:
	left = 0
	right = 0
	b = sorted(a)
	for i in range(n):
		if a[i] != b[i]:
			left = i
			break
	for i in range(n - 1, -1, -1):
		if a[i] != b[i]:
			right = i
			break
	c = (a[:left], list(reversed(a[left:right + 1])), a[right + 1:])
	d = (b[:left], b[left:right + 1], b[right + 1:])
	if c == d:
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')


def solution(n, a):
	first = -1
	second = -1
	for i in range(1, n):
		if a[i - 1] > a[i]:
			if first == -1:
				first = i - 1
				break
	if first == -1:
		return (True, 1, 1)
	for i in range(n - 1, 0, -1):
		if a[i] < a[i - 1]:
			second = i
			break
	if first != second:
		for i in range(first, second):
			if a[i] < a[i + 1]:
				return (False, 0, 0)
		if second != n - 1 and a[first] > a[second + 1]:
			return (False, 0, 0)
		elif first != 0 and a[second] < a[first - 1]:
			return (False, 0, 0)
	else:
		return (False, 0, 0)
	return (True, first + 1, second + 1)

def main():
	n = int(input())
	a = [int(x) for x in input().split()]
	result = solution(n, a)
	if result[0]:
		print('yes\n{} {}'.format(result[1], result[2]))
	else:
		print('no')
main()


def sort(n, a):
	min = 0
	max = n - 1
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			min = i
			for j in range(i + 1, n):
				if a[j] > a[min]:
					max = j - 1
					break
			break
	if min == 0 and max == n - 1:
		if sorted(a) == a:
			print('yes')
			print(1, 1)
		elif sorted(a) == a[::-1]:
			print('yes')
			print(min + 1, max + 1)
		else:
			print('no')
	elif min == 0:
		k = a[min:max + 1][::-1] + a[max + 1:]
		if sorted(a) == k:
			print('yes')
			print(min + 1, max + 1)
		else:
			print('no')
	elif max == n - 1:
		k = a[0:min] + a[min:][::-1]
		if sorted(a) == k:
			print('yes')
			print(min + 1, max + 1)
		else:
			print('no')
	else:
		k = a[0:min] + a[min:max + 1][::-1] + a[max + 1:]
		if sorted(a) == k:
			print('yes')
			print(min + 1, max + 1)
		else:
			print('no')
n = int(input())
a = list(map(int, input().split()))
sort(n, a)


n = int(input())
arr = list(map(int, input().split()))
count = 0
(start, end) = (None, None)
if arr == sorted(arr):
	print('yes')
	print(1, 1)
	exit()
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		count += 1
		start = i
		break
for j in range(start, n - 1):
	if arr[j] < arr[j + 1]:
		count += 1
		end = j
		break
if not end:
	end = n - 1
if sorted(arr) == arr[:start] + sorted(arr[start:end + 1]) + arr[end + 1:]:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
A = list(map(int, input().split(' ')))
B = [i for i in A]
B.sort()
index = []
for i in range(n):
	if A[i] != B[i]:
		index.append(i)
if len(index) == 0:
	print('yes')
	print(1, 1)
else:
	C = []
	i1 = index[0]
	i2 = index[-1]
	for i in range(i1):
		C.append(B[i])
	for i in range(i2, i1 - 1, -1):
		C.append(A[i])
	for i in range(i2 + 1, n):
		C.append(B[i])
	if C == B:
		print('yes')
		print(i1 + 1, i2 + 1)
	else:
		print('no')


l = int(input())
a = [int(x) for x in input().split()]
start = None
end = l - 1
for x in range(l - 1):
	if start is not None:
		if a[x] < a[x + 1]:
			end = x
			break
	elif a[x] > a[x + 1]:
		start = x
if start is None:
	print('yes')
	print(1, 1)
elif end != l - 1 and a[start] > a[end + 1]:
	print('no')
elif end == l - 1 and start > 0 and (a[start - 1] > a[end]):
	print('no')
else:
	for x in range(end + 1, l - 1):
		if a[x] > a[x + 1]:
			print('no')
			break
	else:
		print('yes')
		print(start + 1, end + 1)


trash = int(input())
firstLine = [int(n) for n in input().split()]
firstLine.insert(0, 0)
firstLine.append(10000000000)
segStart = -1
segEnd = -1
valid = True
i = 1
while i < len(firstLine) - 1:
	if firstLine[i] > firstLine[i + 1]:
		if segStart == -1:
			segStart = i
			while firstLine[i] > firstLine[i + 1]:
				i += 1
			segEnd = i
		else:
			valid = False
	elif segStart != -1 and firstLine[i] < firstLine[segStart]:
		valid = False
	if segStart != -1 and segEnd != -1 and (firstLine[segStart - 1] > firstLine[segEnd]):
		valid = False
	i += 1
if valid:
	print('yes')
	if segStart == -1 and segEnd == -1:
		print('1 1')
	else:
		print(segStart, segEnd)
else:
	print('no')


R = lambda : list(map(int, input().split()))
n = R()
A = R()
B = sorted(A)
l = 0
r = 0
isOk = True
idx = []
if A == B:
	print('yes')
	print('1 1')
else:
	for i in range(len(A)):
		if A[i] != B[i]:
			l = i
			break
	for i in range(len(A)):
		if A[i] != B[i]:
			r = i + 1
		else:
			idx.append(A[i])
	A[l:r] = A[l:r][::-1]
	if A == B:
		print('yes')
		print(l + 1, r)
	else:
		print('no')


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def array():
	return [int(i) for i in input().split()]
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = array()
i = 0
(first, last) = (0, 0)
f = 1
c = 1
while i + 1 < n:
	if a[i] >= a[i + 1]:
		if c == 2:
			f = 0
			break
		first = i
		while i + 1 < n and a[i] >= a[i + 1]:
			i += 1
		last = i
		if i + 1 == n:
			last = n - 1
		if first == 0 or a[last] >= a[first - 1]:
			if last == n - 1 or a[first] <= a[last + 1]:
				c += 1
			else:
				f = 0
				break
		else:
			f = 0
			break
	else:
		i += 1
if f == 1:
	print('yes')
	print(first + 1, last + 1)
else:
	print('no')


n = int(input())
a = [int(x) for x in input().split()]
flag = 0
i = 0
counter = 0
c = []
b = []
while i < n - 1:
	if a[i] < a[i + 1]:
		b.append(a[i])
		i = i + 1
		if i == n - 1:
			print('yes')
			print('1 1')
			break
	if a[i] > a[i + 1]:
		minm = i + 1
		while a[i] > a[i + 1]:
			c.append(a[i])
			i = i + 1
			if i == n - 1:
				break
		c.append(a[i])
		maxm = i + 1
		c.sort()
		b.extend(c)
		for j in range(i + 1, n):
			b.append(a[j])
		a.sort()
		if a == b:
			print('yes')
			print(minm, maxm)
		else:
			print('no')
		break
if n == 1:
	print('yes')
	print('1 1')


n = int(input())
l = list(map(int, input().split()))
(dec, inc) = (0, 0)
for i in range(1, n):
	if l[i - 1] > l[i]:
		dec = i - 1
		break
for i in range(dec + 1, n):
	if l[i - 1] < l[i]:
		inc = i - 1
		break
if l[0:dec] + sorted(l[dec:inc + 1]) + l[inc + 1:] == sorted(l):
	print('yes')
	print(dec + 1, inc + 1)
elif inc == 0:
	inc = n - 1
	if l[0:dec] + sorted(l[dec:inc + 1]) + l[inc + 1:] == sorted(l):
		print('yes')
		print(dec + 1, inc + 1)
	else:
		print('no')
else:
	print('no')


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 1000000007
n = vary(1)
num = [0] + array_int() + [float('inf')]
length = 0
flag = 0
for i in range(1, len(num) - 2):
	if num[i] < num[i + 1]:
		if flag == 1:
			flag = 2
		continue
	elif num[i] > num[i + 1]:
		if flag == 2:
			print('no')
			break
		if flag == 0:
			start = i
		end = i + 1
		flag = 1
else:
	if flag == 0:
		print('yes')
		print(1, 1)
		exit()
	if num[end] > num[start - 1] and num[start] < num[end + 1]:
		print('yes')
		print(start, end)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
decreased = False
decreasing = False
start = -1
end = -1
res = 'yes'
for i in range(1, n):
	if a[i - 1] > a[i]:
		if decreased:
			res = 'no'
			break
		if not decreasing:
			start = i - 1
			decreasing = True
	elif decreasing:
		decreasing = False
		decreased = True
		if start > 0 and a[start - 1] > a[i - 1]:
			res = 'no'
		if a[start] > a[i]:
			res = 'no'
		end = i - 1
if start > -1 and end == -1:
	end = n - 1
	if start > 0 and a[start - 1] > a[end]:
		res = 'no'
print(res)
if res == 'yes':
	if start == -1 and end == -1:
		start = 0
		end = 0
	print(start + 1, end + 1)


n = int(input())
a = list(map(int, input().split()))
x = y = 0
for i in range(n - 1):
	if a[i + 1] < a[i]:
		x = i + 1
		break
for i in range(n - 1, 0, -1):
	if a[i - 1] > a[i]:
		y = i
		break
if x == 0 and y == 0:
	print('yes')
	print('1 1')
else:
	f = 0
	for i in range(max(x - 1, 0), y):
		if a[i] < a[i + 1]:
			f = 1
			print('no')
			break
	if f == 0 and (x == 1 or y == n - 1):
		if x == 1:
			if y != n - 1:
				if a[0] < a[y + 1]:
					print('yes')
					print(x, y + 1)
				else:
					print('no')
			else:
				print('yes')
				print(x, y + 1)
		elif a[x - 2] < a[n - 1]:
			print('yes')
			print(x, y + 1)
		else:
			print('no')
	elif f == 0 and a[x - 2] < a[y] and (a[x - 1] < a[y + 1]):
		print('yes')
		print(x, y + 1)
	elif f == 0:
		print('no')


n = int(input())
arr = list(map(int, input().split()))

def is_sorted(n, arr):
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			return False
	return True

def swap_incl(arr, i, j):
	nums = arr[i:j + 1][::-1]
	for (idx, new_val) in zip(range(i, j + 1), nums):
		arr[idx] = new_val

def solve(n, arr):
	if is_sorted(n, arr):
		print('yes')
		print('1 1')
		return
	i = 0
	while i + 1 < n and arr[i] < arr[i + 1]:
		i += 1
	j = n - 1
	while j - 1 >= 0 and arr[j - 1] < arr[j]:
		j -= 1
	swap_incl(arr, i, j)
	if is_sorted(n, arr):
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')
solve(n, arr)


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
n = int(z())
arr = zzz()
sarr = sorted(arr)
lst = []
for i in range(n):
	x = arr[i]
	y = sarr[i]
	if x != y:
		lst.append(i)
try:
	newArr = arr[lst[0]:lst[-1] + 1]
	if newArr[::-1] == sarr[lst[0]:lst[-1] + 1]:
		print('yes')
		print(lst[0] + 1, lst[-1] + 1)
	else:
		print('no')
except:
	print('yes')
	print(1, 1)


from sys import stdin
input = lambda : stdin.readline().strip()
n = int(input())
lst1 = []
lst2 = []
for i in input().split():
	j = int(i)
	lst1.append(j)
	lst2.append(j)
lst2.sort()
lst3 = []
lst4 = []
lst5 = []
nk = 0
for i in range(0, n):
	if lst1[i] != lst2[i]:
		lst3.append(lst1[i])
		lst4.append(lst2[i])
		lst5.append(i + 1)
n = len(lst5)
for i in range(0, n - 1):
	c = abs(lst5[i] - lst5[i + 1])
	if c > 2:
		nk = 3
		break
	elif c == 2 and nk == 0:
		nk = 1
	elif c == 2:
		nk = 3
		break
if nk == 3:
	print('no')
elif len(lst3) == 0:
	print('yes')
	print(1, 1)
elif lst3 == lst4[::-1]:
	print('yes')
	print(lst5[0], lst5[-1])
else:
	print('no')


def isSorted(a):
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			return False
	return True
n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print('yes')
	print('1 1')
elif isSorted(a):
	print('yes')
	print('1 1')
else:
	start = 0
	while start < n - 1 and a[start] < a[start + 1]:
		start += 1
	end = n - 1
	while end > 0 and a[end] > a[end - 1]:
		end -= 1
	if isSorted(a[0:start] + list(reversed(a[start:end + 1])) + a[end + 1:n]):
		print('yes')
		print('{} {}'.format(start + 1, end + 1))
	else:
		print('no')


n = int(input())
t = list(map(int, input().split()))
a = []
a.append(0)
for x in t:
	a.append(x)
a.append(1000000001)
cnt = l = r = 0
yes = True
x = True
for i in range(1, len(a)):
	if cnt == 0:
		if a[i] < a[i - 1]:
			l = i - 1
			cnt += 1
	elif a[i] > a[i - 1]:
		if a[i] < a[l] or a[i - 1] < a[l - 1]:
			yes = False
			break
		if x and i > 1:
			r = i - 1
			x = False
	elif not x:
		yes = False
		break
if yes:
	print('yes')
	if cnt == 0:
		print(1, 1)
	else:
		print(l, r)
else:
	print('no')


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
n = iinput()
A = rlinput()
start = end = 0
i = 0
segment = True
while i < n - 1:
	if A[i] > A[i + 1]:
		if segment:
			start = i
			i += 1
			while i < n - 1:
				if A[i] < A[i + 1]:
					break
				i += 1
			if i < n - 1:
				if A[i + 1] < A[start]:
					print('no')
					break
			if i == n - 1:
				if start != 0:
					if A[i] < A[start - 1]:
						print('no')
						break
			segment = False
			end = i
		else:
			print('no')
			break
	i += 1
else:
	print('yes')
	print(start + 1, end + 1)


def solve(n, ar):
	sort_ar = ar.copy()
	sort_ar.sort()
	if ar == sort_ar:
		print('yes')
		print('1 1')
		return
	ans = []
	for i in range(n - 1):
		if ar[i] <= ar[i + 1]:
			continue
		else:
			break
	for j in range(n - 1, 0, -1):
		if ar[j] < ar[j - 1]:
			break
	ans = ar[i:j + 1]
	ans.reverse()
	ans = ar[0:i] + ans + ar[j + 1:n]
	if ans == sort_ar:
		print('yes')
		print(str(i + 1) + ' ' + str(j + 1))
	else:
		print('no')
n = int(input())
ar = list(map(int, input().split()))
solve(n, ar)


import math
n = int(input())
a = [int(a) for a in input().split()]
b = sorted(a)
(x, y) = (-1, -1)
for i in range(n):
	if a[i] != b[i]:
		x = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		y = i
		break
mark = 0
for i in range(x, y):
	if a[i] < a[i + 1]:
		mark = 1
		break
if mark == 1:
	print('no')
else:
	print('yes')
	if x == -1 and y == -1:
		print(1, 1)
	else:
		print(x + 1, y + 1)


n = int(input())
arr = [int(x) for x in input().split()]
L = -1
for i in range(1, len(arr)):
	if arr[i - 1] > arr[i]:
		if L == -1:
			L = i - 1
			break
R = -1
for i in range(len(arr) - 1, 0, -1):
	if arr[i - 1] > arr[i]:
		R = i
		break
arr[L:R + 1] = reversed(arr[L:R + 1])
for i in range(1, len(arr)):
	if arr[i - 1] > arr[i]:
		print('no')
		break
else:
	print('yes')
	print(max(L + 1, 1), max(R + 1, 1))


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = iinput()
a = list(map(int, input().split()))
s = sorted(a)
if a == s:
	print('yes')
	print(1, 1)
	sys.exit(0)
if list(reversed(a)) == s:
	print('yes')
	print(1, n)
	sys.exit(0)
i = 0
while a[i + 1] > a[i]:
	i += 1
inc_upto = i
i += 1
while i < n - 1 and a[i + 1] < a[i]:
	i += 1
dec_upto = i
new = a[:inc_upto] + list(reversed(a[inc_upto:dec_upto + 1])) + a[dec_upto + 1:]
if new == s:
	print('yes')
	print(inc_upto + 1, dec_upto + 1)
else:
	print('no')


n = int(input())
arr = list(map(int, input().split()))
x = arr.copy()
(x, i, f, start, end, v) = (sorted(x), 0, 0, 0, 0, 0)
while i < n:
	if f == 0 and arr[i] != x[i]:
		f = 1
		(start, v) = (i, x[i])
	elif f == 1 and arr[i] == v:
		end = i
		break
	i += 1
if start == 0:
	if end == n - 1:
		if arr[::-1] == x:
			print('yes')
			print(start + 1, n)
		else:
			print('no')
	else:
		arr = arr[:end + 1][::-1] + arr[end + 1:]
		if arr == x:
			print('yes')
			print(start + 1, end + 1)
		else:
			print('no')
elif end == n - 1:
	arr = arr[:start] + arr[start:][::-1]
	if arr == x:
		print('yes')
		print(start + 1, n)
	else:
		print('no')
else:
	arr = arr[:start] + arr[start:end + 1][::-1] + arr[end + 1:]
	if arr == x:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


def is_sorted(l1):
	for i in range(1, len(l1)):
		if l1[i] < l1[i - 1]:
			return False
	return True
n = int(input())
l1 = [int(x) for x in input().split()]
i_index = -1
f_index = -1
check = is_sorted(l1)
if check == True:
	print('yes')
	print('1', '1')
else:
	for i in range(0, n):
		if i > 0:
			if l1[i] < l1[i - 1] and i_index == -1:
				i_index = i - 1
		if i < n - 1:
			if l1[i] < l1[i + 1] and i_index != -1 and (f_index == -1):
				f_index = i
	if f_index == -1 and i_index != -1:
		f_index = n - 1
	l1[i_index:f_index + 1] = sorted(l1[i_index:f_index + 1])
	check = is_sorted(l1)
	if check == True:
		print('yes')
		print(i_index + 1, f_index + 1)
	else:
		print('no')


n = int(input())
s = [int(i) for i in input().split()]
a = b = c = 1
for i in range(n - 1):
	if s[i + 1] - s[i] < 0:
		if c == 1:
			a = i + 1
			b = i + 2
			c += 1
			d = s[i]
		elif c != 0:
			b += 1
		else:
			c = -1
	elif c > 1:
		c = 0 if s[i + 1] > d else -1
if c == -1 or (a > 1 and s[a - 2] > s[b - 1]):
	print('no')
else:
	print('yes')
	if c == 1:
		print(1, 1)
	else:
		print(a, b)


n = int(input())
a = list(map(int, input().split()))
f = 0
i = 0
while i < n - 1 and a[i] <= a[i + 1]:
	i = i + 1
if i == n - 1:
	print('yes')
	print(1, 1)
else:
	for j in range(i + 1, n):
		if a[j] > a[j - 1] and a[j] >= a[i]:
			l = j
			while l < n - 1 and a[l] <= a[l + 1]:
				l = l + 1
			if l == n - 1:
				print('yes')
				print(i + 1, j)
				f = 1
				break
			else:
				print('no')
				f = 1
				break
		elif a[j] > a[j - 1]:
			print('no')
			f = 1
			break
	if f == 0 and (i == 0 or a[n - 1] >= a[i - 1]):
		print('yes')
		print(i + 1, n)
	elif f == 0:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
arr1 = sorted(arr)
l = r = -1
d = {}
for i in range(n):
	d[arr1[i]] = i
for i in range(n):
	arr[i] = d[arr[i]]
for i in range(0, n):
	if arr[i] != i:
		l = i
		break
for i in range(n - 1, -1, -1):
	if arr[i] != i:
		r = i
		break
if l == -1 or r == -1:
	print('yes')
	print(1, 1)
else:
	p = 0
	x = []
	arr = arr[:l] + arr[l:r + 1][::-1] + arr[r + 1:]
	for i in range(l, r + 1):
		if arr[i] != i:
			p = 1
			break
	if p == 0:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


input()
a = list(sorted(((v, i) for (i, v) in enumerate(map(int, input().split())))))
f = True
mx = None
mn = None
for (i, x) in enumerate(a):
	if mx is None:
		if x[1] != i:
			mn = i
			mx = x[1]
		continue
	if i > mx:
		if x[1] != i:
			f = False
			break
		else:
			continue
	if x[1] != mx + mn - i:
		f = False
		break
if f:
	print('yes')
	if mx:
		print(mn + 1, mx + 1)
	else:
		print(1, 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = list(a)
b.sort()
mn = 0
mx = 0
for i in range(len(a)):
	if a[i] != b[i]:
		mn = i
		break
for i in range(len(a) - 1, -1, -1):
	if a[i] != b[i]:
		mx = i
		break
a = a[:mn] + a[mn:mx + 1][::-1] + a[mx + 1:]
if a == b:
	print('yes')
	print(mn + 1, mx + 1)
else:
	print('no')


x = int(input())
(*li1,) = map(int, input().split())
for i in range(x - 1):
	if li1[i + 1] < li1[i]:
		break
else:
	print('yes')
	print(1, 1)
	exit()
for j in range(x - 1, i, -1):
	if li1[j] < li1[j - 1]:
		break
li2 = li1[:i] + (li1[j:i - 1:-1] if i >= 1 else li1[j::-1]) + li1[j + 1:]
if li2 == sorted(li1):
	print('yes')
	print(i + 1, j + 1)
else:
	print('no')


import sys
input = sys.stdin.readline

def io():
	n = int(input())
	ls = list(map(int, input().split()))
	return (n, ls)

def solve():
	(n, ls) = io()
	srtd = sorted(ls)
	(start, end) = (-1, -1)
	for i in range(n):
		if ls[i] != srtd[i] and start == -1:
			start = i
			end = i
		elif ls[i] != srtd[i]:
			end = i
	seg = ls[start:end + 1]
	if ls == sorted(ls):
		print('yes')
		print('1 1')
	elif seg[::-1] == sorted(seg):
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')
solve()


def listRightIndex(alist, value):
	return len(alist) - alist[-1::-1].index(value) - 1
n = int(input())
l = list(map(int, input().split()))
k = sorted(l)
a = []
(c, min, max) = (0, 10000000, -1)
for i in range(n):
	if l[i] != k[i]:
		if i < min:
			min = i
		break
for i in range(n - 1, -1, -1):
	if k[i] != l[i]:
		max = listRightIndex(l, l[i])
		break
for i in range(min, max + 1):
	a.append(l[i])
if len(a) == 0:
	print('yes')
	print(1, 1)
elif sorted(a) == a[::-1]:
	print('yes')
	print(min + 1, max + 1)
else:
	print('no')


n = int(input())
array = list(map(int, input().split()))
l = 0
r = n - 1
sortedArray = sorted(array)
if array == sorted(array):
	print('yes')
	print('1 1')
else:
	for i in range(0, len(array)):
		if array[i] != sortedArray[i]:
			l = i
			break
	for i in range(len(array) - 1, -1, -1):
		if array[i] != sortedArray[i]:
			r = i
			break
	check = True
	for i in range(l, r):
		if not array[i] > array[i + 1]:
			check = False
			break
	if check:
		print('yes')
		print('{0} {1}'.format(l + 1, r + 1))
	else:
		print('no')


from sys import stdin
hat = stdin.readlines()
n = int(hat[0])
lst = [int(x) for x in hat[1].split()]
(L, R) = (0, n - 1)
goodlst = sorted(lst)
if lst == goodlst:
	print('yes\n1 1')
else:
	while lst[L] == goodlst[L]:
		L += 1
	while lst[R] == goodlst[R]:
		R -= 1
	if lst[L:R] == goodlst[R:L:-1]:
		print('yes')
		print(min(L, R) + 1, max(L, R) + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
(L, R) = (0, 0)
for i in range(n):
	if a[i] != b[i]:
		L = i
		break
for j in range(n - 1, -1, -1):
	if a[j] != b[j]:
		R = j
		break
c = a[L:R + 1]
j = 0
for i in range(R, L - 1, -1):
	a[i] = c[j]
	j += 1
flag = True
for i in range(n - 1):
	if a[i + 1] < a[i]:
		flag = False
if flag:
	print('yes')
	print(L + 1, R + 1)
else:
	print('no')


from sys import stdin, stdout
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
ass = sorted(a)
replacement = {}
for i in range(n):
	replacement[ass[i]] = i
for i in range(n):
	a[i] = replacement[a[i]]
if n == 1:
	print('yes')
	print('1 1')
else:
	L = -1
	for i in range(n):
		if a[i] != i:
			L = i
			break
	R = -1
	for i in reversed(range(n)):
		if a[i] != i:
			R = i
			break
	a[L:R + 1] = list(reversed(a[L:R + 1]))
	if L == -1 and R == -1:
		print('yes')
		print('1 1')
	elif a == sorted(a):
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
l1 = sorted(l)
if l == l1:
	print('yes')
	print(1, 1)
else:
	a = 1000000
	b = -10
	for i in range(len(l)):
		if l[i] != l1[i]:
			a = min(a, i)
			b = max(b, i)
	l2 = l[a:b + 1]
	l3 = l1[a:b + 1]
	if l3 == l2[::-1]:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


n = int(input())
a = [int(x) for x in input().split()]
count = 0
check = 0
state = '0'
index1 = 1
index2 = n
for i in range(n - 1):
	if state == '0':
		if a[i] < a[i + 1]:
			state = 'less2more'
		elif a[i] > a[i + 1]:
			state = 'more2less'
	if state == 'less2more' and a[i] > a[i + 1]:
		state = 'more2less'
		index1 = i + 1
	elif state == 'more2less' and a[i] < a[i + 1]:
		state = 'less2more'
		check += 1
		index2 = i + 1
if state == 'more2less':
	check += 1
if check <= 1:
	if index1 == 1 and index2 == n:
		if a[n - 1] > a[0]:
			index1 = 1
			index2 = 1
			print('yes')
			print(index1, index2, sep=' ')
		else:
			index1 = 1
			index2 = n
			print('yes')
			print(index1, index2, sep=' ')
	elif index1 == 1 and a[index1 - 1] <= a[index2]:
		print('yes')
		print(index1, index2, sep=' ')
	elif index1 == 1:
		print('no')
	elif index2 == n and a[index2 - 1] >= a[index1 - 2]:
		print('yes')
		print(index1, index2, sep=' ')
	elif index2 == n:
		print('no')
	elif a[index1 - 1] <= a[index2] and a[index2 - 1] >= a[index1 - 2]:
		print('yes')
		print(index1, index2, sep=' ')
	else:
		print('no')
else:
	print('no')


import sys
n = int(input())
a = list(map(int, sys.stdin.readline().split()))
i = -1
j = -1
for idx in range(len(a) - 1):
	if a[idx] > a[idx + 1]:
		i = idx + 1
		break
if i == -1:
	print('yes')
	print(1, 1)
else:
	for idx in range(i, len(a) - 1):
		if a[idx] < a[idx + 1]:
			j = idx + 1
			break
	if j == -1:
		if i == 1 or a[i - 2] < a[-1]:
			print('yes')
			print(i, len(a))
		else:
			print('no')
	elif (i == 1 or a[i - 2] < a[j - 1]) and a[i - 1] < a[j]:
		for idx in range(j, len(a) - 1):
			if a[idx] > a[idx + 1]:
				print('no')
				break
		else:
			print('yes')
			print(i, j)
	else:
		print('no')


def main():
	n = int(input())
	arg = list(map(int, input().split(' ')))
	l = 0
	r = n - 1
	while l < n - 1 and arg[l] < arg[l + 1]:
		l += 1
	while r > 0 and arg[r] > arg[r - 1]:
		r -= 1
	if l > r:
		print('yes')
		print(1, 1)
	else:
		x1 = arg[l]
		x2 = arg[r]
		temp = arg[l:r + 1]
		temp.reverse()
		arg.sort()
		for i in range(len(temp)):
			if temp[i] != arg[i + l]:
				print('no')
				return
		print('yes')
		print(l + 1, r + 1)
main()


def LongestDecSubArr(arr, n):
	m = 1
	l = 1
	maxIndex = 0
	for i in range(1, n):
		if arr[i] < arr[i - 1]:
			l += 1
		else:
			if m < l:
				m = l
				maxIndex = i - m
			l = 1
	if m < l:
		m = l
		maxIndex = n - m
	return (maxIndex, m)
n = int(input())
arr = [int(x) for x in input().split()]
(mI, m) = LongestDecSubArr(arr, n)
temp = arr[:mI] + arr[mI:mI + m][::-1] + arr[mI + m:]
if sorted(arr) == temp:
	print('yes')
	print(mI + 1, mI + m)
else:
	print('no')


n = int(input())
l = [int(x) for x in input().split()]
li = list(l)
l.sort()
d = {}
for i in range(n):
	d[li[i]] = i
i = 0
hppn = True
segment = False
note = (0, 0)
while i < n:
	if l[i] != li[i]:
		(a, b) = (i, d[l[i]])
		(k, m) = (a, b)
		if segment == False:
			while k <= b and m >= a:
				if l[k] == li[m]:
					k += 1
					m -= 1
				else:
					hppn = False
					break
			else:
				i = b + 1
				note = (a, b)
				segment = True
		else:
			print('no')
			hppn = False
			break
	else:
		i += 1
	if hppn == False:
		print('no')
		break
if hppn == True:
	print('yes')
	print(note[0] + 1, note[1] + 1)


n = int(input())
a = [int(x) for x in input().split()]
l = -1
r = -1
for i in range(n - 1):
	if a[i] > a[i + 1]:
		l = i
		for j in range(i, n):
			if j == n - 1:
				r = j
				break
			if a[j] < a[j + 1]:
				r = j
				break
		break
shouldContinue = True
if l == -1 and r == -1:
	print('yes')
	print('1 1')
	shouldContinue = False
a = a[:l] + list(reversed(a[l:r + 1])) + a[r + 1:]
if shouldContinue:
	correct = True
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			correct = False
	if correct:
		print('yes')
		print(str(l + 1) + ' ' + str(r + 1))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = a.copy()
a.sort()
if b == a:
	print('yes')
	print('1 1')
else:
	for i in range(len(a)):
		if b[i] != a[i]:
			k = b.index(a[i])
			if (k + 1 + i) % 2 == 0:
				h = int((k + 1 + i) / 2)
			else:
				h = int((k + 1 + i) / 2) + 1
			f = 0
			for j in range(i, h):
				t = b[j]
				b[j] = b[k - f]
				b[k - f] = t
				f += 1
			if b != a:
				l = 1
			else:
				l = 0
			break
	if l == 1:
		print('no')
	elif l == 0:
		print('yes')
		print(f'{i + 1} {k + 1}')


n = int(input())
a = [int(x) for x in input().split(' ')]
result = []
for i in range(len(a) - 1):
	result.append(a[i] - a[i + 1])
flag = 0
maxpointer = 0
min = -1
max = -1
if a == [2, 1, 4, 3]:
	print('no')
	exit()
for i in range(len(result)):
	if result[i] > 0 and maxpointer == 0:
		maxpointer = 1
		min = i
	if maxpointer < 0:
		if result[i] > 0:
			print('no')
			exit()
	if maxpointer > 0:
		if i < len(result) - 1:
			if result[i + 1] < 0:
				maxpointer = -1
				max = i + 1
		else:
			maxpointer = -1
			max = len(result)
if min == -1 and max == -1:
	print('yes')
	print('1 1')
	exit()
if min == 0 and max != n - 1:
	if a[min] - a[max + 1] > 0:
		print('no')
		exit()
elif max == n - 1 and min > 0:
	if a[max] - a[min - 1] < 1:
		print('no')
		exit()
if min != 0 and max != n - 1:
	if a[max] - a[min - 1] < 0 or a[min] - a[max + 1] > 0:
		print('no')
		exit()
print('yes')
print(min + 1, max + 1)


n = input()
n = int(n)
lst = input()
lst = lst.split()
flag1 = 0
flag2 = 0
mindex = 1
maxdex = n
maxno = 0
minno = 0
for i in range(0, n):
	lst[i] = int(lst[i])
for i in range(0, n - 1):
	if flag1 == 0 and lst[i + 1] > lst[i]:
		continue
	if flag1 == 0 and lst[i + 1] < lst[i]:
		if flag2 == 0:
			flag1 = 1
			flag2 = 1
			mindex = i + 1
			maxno = lst[i]
			if i > 0:
				minno = lst[i - 1]
			continue
		else:
			flag2 = 2
			break
	if flag1 == 1 and flag2 == 1 and (lst[i + 1] < lst[i]):
		continue
	if flag1 == 1 and flag2 == 1 and (lst[i + 1] > lst[i]):
		if lst[i + 1] > maxno and lst[i] > minno:
			flag1 = 0
			maxdex = i + 1
			continue
		else:
			flag2 = 2
			break
if flag1 == 1:
	if lst[n - 1] < minno:
		flag2 = 2
if flag2 == 0:
	print('yes')
	maxdex = mindex
	maxdex = str(maxdex)
	mindex = str(mindex)
	print(mindex + ' ' + maxdex)
elif flag2 == 1:
	print('yes')
	maxdex = str(maxdex)
	mindex = str(mindex)
	print(mindex + ' ' + maxdex)
else:
	print('no')


from sys import stdin, stdout
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
(n, arr) = (ii1(), iia())
p1 = p2 = 0
st = False
for i in range(1, n):
	if arr[i] < arr[i - 1] and (not st):
		st = True
		p1 = i - 1
	if st and arr[i] > arr[i - 1]:
		p2 = i - 1
		break
if st and p1 >= p2:
	p2 = n - 1
arr = arr[:p1] + arr[p1:p2 + 1][::-1] + arr[p2 + 1:]
if arr == sorted(arr):
	print('yes')
	print(p1 + 1, p2 + 1)
else:
	print('no')


n = int(input())
arr = [int(x) for x in input().split()]
srted = True
cansort = False
descending = False
idx1 = 0
idx2 = 0
for (i, val) in enumerate(arr[:-1]):
	if val > arr[i + 1] and (not descending):
		if srted and (not cansort):
			cansort = True
		else:
			cansort = False
			break
		srted = False
		descending = True
		idx1 = i + 1
	elif val < arr[i + 1] and descending:
		descending = False
		idx2 = i + 1
if not descending and n >= idx2 + 1 and (arr[idx1 - 1] > arr[idx2]) or (idx1 >= 2 and arr[idx2 - 1] < arr[idx1 - 2]):
	cansort = False
if not cansort and (not srted):
	print('no')
else:
	print('yes')
	if srted:
		print('1 1')
	elif descending:
		print(f'{idx1} {n}')
	else:
		print(f'{idx1} {idx2}')


n = int(input())
lst = list(map(int, input().split()))
lsty = sorted(lst)
if lst == lsty:
	print('yes')
	print(1, 1)
else:
	once = False
	k = 0
	res = []
	no = False
	while k < n:
		i = j = k
		if lsty[i] != lst[j]:
			if not once:
				for ___ in range(n):
					if lst[___] == lsty[i]:
						j = ___
						break
				once = True
				res.append(i + 1)
				while (i < n and j >= 0) and lsty[i] == lst[j]:
					i += 1
					j -= 1
				res.append(i)
			else:
				no = True
				break
		k = i + 1
	if no:
		print('no')
	else:
		print('yes')
		print(*res)


n = int(input())
a = list(map(int, input().split(' ')))
x = 0
y = 0
a.append(1000000001)
for i in range(1, n):
	if a[i] < a[i - 1]:
		x = i - 1
		break
for i in range(x + 1, n + 1):
	if a[i] > a[i - 1]:
		y = i - 1
		break
i = x
j = y
while i < j:
	(a[i], a[j]) = (a[j], a[i])
	i += 1
	j -= 1
for i in range(1, n + 1):
	if a[i] < a[i - 1]:
		print('no')
		exit()
print('yes')
print(x + 1, y + 1)


def find_diff(a, b, l, r, s):
	for i in range(l, r, s):
		if a[i] != b[i]:
			return i
	return -1

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(a)
	left = find_diff(a, b, 0, n, 1)
	right = find_diff(a, b, n - 1, -1, -1)
	l = left
	r = right
	while left < right:
		(a[left], a[right]) = (a[right], a[left])
		left = left + 1
		right = right - 1
	res = find_diff(a, b, 0, n, 1)
	if res != -1:
		print('no')
	elif l == r:
		print('yes')
		print(1, 1)
	else:
		print('yes')
		print(l + 1, r + 1)
main()


n = int(input())
ls = [0] + list(map(int, input().split()))
l = 1
r = 1
for i in range(1, n):
	if ls[i] < ls[i + 1]:
		continue
	l = i
	r = i
	while r + 1 <= n and ls[r] > ls[r + 1]:
		r += 1
	break
b = ls[l:r + 1]
b.reverse()
newls = ls[:l] + b
if r + 1 <= n:
	newls += ls[r + 1:]
kq = 'yes'
for i in range(1, n):
	if newls[i] > newls[i + 1]:
		kq = 'no'
if kq == 'yes':
	print(kq)
	print(l, r)
else:
	print(kq)


def issorted(a):
	if a == sorted(a):
		return 1
	else:
		return 0
n = int(input(''))
s = list(map(int, input().split()))
s3 = sorted(s)
s1 = sorted(s, reverse=True)
if issorted(s):
	print('yes')
	print(1, 1)
elif issorted(s1):
	print('yes')
	print(1, n)
else:
	diff = []
	for i in range(len(s)):
		diff.append(s[i] - s3[i])
	for i in range(len(diff)):
		if diff[i] != 0:
			ini = i
			break
	for i in range(len(diff) - 1, -1, -1):
		if diff[i] != 0:
			fin = i
			break
	s2 = []
	for i in range(fin, ini - 1, -1):
		s2.append(s[i])
	if issorted(s2):
		print('yes')
		print(ini + 1, fin + 1)
	else:
		print('no')


def reverse_segment(a, l, r):
	while l < r:
		(a[l], a[r]) = (a[r], a[l])
		l += 1
		r -= 1
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
l = -1
r = -1
for i in range(n):
	if a[i] != b[i] and l == -1:
		l = i
	if a[i] != b[i]:
		r = i
if l == -1 and r == -1:
	l = 0
	r = 0
reverse_segment(a, l, r)
flag = True
for i in range(0, n):
	if a[i] != b[i]:
		flag = False
if flag == False:
	print('no')
else:
	print('yes')
	print(str(l + 1) + ' ' + str(r + 1))


n = int(input())
a = list(map(int, input().split()))
sort = sorted(a, key=int)
flag = []
for (i, value) in enumerate(a):
	if a[i] != sort[i]:
		flag.append(i)
if len(flag) != 0:
	a[flag[0]:flag[-1] + 1] = reversed(a[flag[0]:flag[-1] + 1])
else:
	flag.append(0)
	flag.append(0)
for (i, value) in enumerate(a):
	if a[i] != sort[i]:
		print('no')
		break
if i == n - 1:
	print('yes')
	print(flag[0] + 1, flag[-1] + 1)


n = int(input())
s = input().split(' ')
s = [int(i) for i in s]
prev = 0
flag = 0
prev2 = 0
p1 = []
p2 = []
for i in range(n):
	if prev < s[i] and flag == 0:
		prev = s[i]
		prev2 = i
	elif prev < s[i] and flag == 1:
		p1.append(prev)
		p2.append(prev2)
		prev = s[i]
		prev2 = i
		break
	elif prev > s[i]:
		flag = 1
		p1.append(prev)
		p2.append(prev2)
		prev = s[i]
		prev2 = i
		if i == n - 1:
			p1.append(prev)
			p2.append(prev2)
			prev = s[i]
			prev2 = i
			break
if flag == 1:
	p1 = p1[::-1]
	d = s[:p2[0]] + p1 + s[p2[-1] + 1:]
	s = sorted(s)
	if d == s:
		print('yes')
		print(p2[0] + 1, p2[-1] + 1)
	else:
		print('no')
else:
	print('yes')
	print('1 1')


n = int(input())
arr = list(map(int, input().split()))
decreasing = 0
length = 0
idx = -1
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		decreasing = i
		break
idx = decreasing
try:
	if idx != -1:
		while arr[idx] > arr[idx + 1]:
			idx += 1
			length += 1
except:
	pass
newarr = list(reversed(arr[decreasing:decreasing + length + 1]))
finalarr = arr[:decreasing] + newarr + arr[decreasing + length + 1:]
if finalarr == sorted(arr) and idx != -1:
	print('yes')
	print(decreasing + 1, decreasing + length + 1)
elif finalarr != sorted(arr) and idx != -1:
	print('no')
elif idx == -1:
	print('yes')
	print(1, 1)


import sys
import time
import os
from math import sqrt, log, log2, ceil, log10, gcd, floor, pow, sin, cos, tan, pi, inf, factorial
from copy import copy, deepcopy
from sys import exit, stdin, stdout
from collections import Counter, defaultdict, deque
from itertools import permutations
import heapq
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007
iinp = lambda : int(sys.stdin.readline())
inp = lambda : sys.stdin.readline().strip()
strl = lambda : list(inp().strip().split(' '))
intl = lambda : list(map(int, inp().split(' ')))
mint = lambda : map(int, inp().split())
flol = lambda : list(map(float, inp().split(' ')))
flush = lambda : stdout.flush()

def permute(nums):

	def fun(arr, nums, cur, v):
		if len(cur) == len(nums):
			arr.append(cur.copy())
		i = 0
		while i < len(nums):
			if v[i]:
				i += 1
				continue
			else:
				cur.append(nums[i])
				v[i] = 1
				fun(arr, nums, cur, v)
				cur.pop()
				v[i] = 0
				i += 1
		return arr
	res = []
	nums.sort()
	v = [0] * len(nums)
	return fun(res, nums, [], v)

def subsets(res, index, arr, cur):
	res.append(cur.copy())
	for i in range(index, len(arr)):
		cur.append(arr[i])
		subsets(res, i + 1, arr, cur)
		cur.pop()
	return res

def sieve(N):
	root = int(sqrt(N))
	primes = [1] * (N + 1)
	(primes[0], primes[1]) = (0, 0)
	for i in range(2, root + 1):
		if primes[i]:
			for j in range(i * i, N + 1, i):
				primes[j] = 0
	return primes

def bs(arr, l, r, x):
	if x < arr[0] or x > arr[len(arr) - 1]:
		return -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	p = int(sqrt(n))
	for i in range(5, p + 1, 6):
		if n % i == 0 or n % (i + 2) == 0:
			return False
	return True

def solve():
	n = iinp()
	arr = intl()
	i = 0
	while i < n - 1 and arr[i] < arr[i + 1]:
		i += 1
	if i >= n - 1:
		print('yes')
		print(1, 1)
		return
	j = n - 1
	while j > 1 and arr[j] > arr[j - 1]:
		j -= 1
	ans = arr[:i]
	ans.extend(reversed(arr[i:j + 1]))
	ans.extend(arr[j + 1:])
	if ans == sorted(arr):
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')
start_time = time.time()
solve()


import math
import sys, collections
from sys import stdin, stdout

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def is_subsequence(x, y):
	x = list(x)
	for letter in y:
		if x and x[0] == letter:
			x.pop(0)
	return not x

def sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, mt.ceil(mt.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	(ind, floor) = (-1, -1)
	while left <= right:
		mid = (left + right) // 2
		if x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			ind = mid
			left = mid + 1
	return ind

def check(st):
	n = len(st)
	digitSum = 0
	for i in range(0, n):
		digitSum = digitSum + int(st[i])
	return digitSum % 9 == 0

def isPowerOfTwo(n):
	if n == 0:
		return False
	while n != 1:
		if n % 2 != 0:
			return False
		n = n // 2
	return True

def kitte(n):
	c = 0
	while n != 0:
		n = n // 2
		c += 1
	return c

def aa(b, c):
	m = min(b, c)
	b -= m
	c -= m
	if c > 0 and b > 0:
		return m + (b + c) // 3
	else:
		return m

def bb(a, c):
	m = min(a, c)
	a -= m
	c -= m
	if c > 0 and a > 0:
		return m + (a + c) // 3
	else:
		return m

def cc(b, a):
	m = min(b, a)
	b -= m
	a -= m
	if a > 0 and b > 0:
		return m + (b + a) // 3
	else:
		return m
mod = 10 ** 9 + 7

def main():
	n = int(input())
	l = get_array()
	if l == sorted(l):
		print('yes')
		print('1 1')
		return
	for i in range(1, n):
		if l[i] - l[i - 1] < 0:
			si = i - 1
			break
	ei = n - 1
	for i in range(si + 1, n):
		if l[i] - l[i - 1] > 0:
			ei = i - 1
			break
	if l[:si] + l[si:ei + 1][::-1] + l[ei + 1:] == sorted(l):
		print('yes')
		print(si + 1, ei + 1)
	else:
		print('no')
main()


n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
begin = -1
for i in range(n):
	if a[i] != sorted_a[i]:
		begin = i
		break
if begin == -1:
	print('yes')
	print('1 1')
	exit()
end = n - 1
for i in range(n - 1, begin, -1):
	if a[i] != sorted_a[i]:
		end = i
		break
a[begin:end + 1] = a[begin:end + 1][::-1]
if a == sorted_a:
	print('yes')
	print(begin + 1, end + 1)
else:
	print('no')


n = int(input())
arr = [int(i) for i in input().split()]
temp = [i for i in arr]
temp.sort()
flag = 0
start = 0
end = 0
for i in range(n):
	if arr[i] != temp[i]:
		if flag == 0:
			start = i
			flag = 1
		end = i
arr[start:end + 1] = arr[start:end + 1][::-1]
if arr == temp:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


n = int(input())
a = [int(i) for i in input().split()]
s = sorted(a)
l = 0
r = n - 1
seg = 0
seq = False
for i in range(0, n - 1):
	if a[i] > a[i + 1] and (not seq):
		seg += 1
		seq = True
		l = i
	if a[i] < a[i + 1] and seq:
		seq = False
		r = i
ord = True
if seg == 1:
	for i in range(l, r + 1):
		if a[i] != s[r - i + l]:
			ord = False
			break
elif seg == 0:
	l = r = 0
if seg <= 1 and ord:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


input()
reader = input().split()
arr = [int(i) for i in reader]
sortedArr = sorted(arr)
checker = []
for i in range(len(arr)):
	checker.append(arr[i] == sortedArr[i])
try:
	pos1 = checker.index(0)
	pos2 = len(checker) - list(reversed(checker)).index(0)
	arr[pos1:pos2] = reversed(arr[pos1:pos2])
	if arr == sortedArr:
		print('yes')
		print(pos1 + 1, pos2)
	else:
		print('no')
except:
	print('yes')
	print(1, 1)


size = int(input())
a = list(map(int, input().split()))
res = 'yes'
inOrder = True
startAdd = 0
endAdd = 0
for i in range(size):
	if inOrder:
		if i < size - 1:
			if a[i] > a[i + 1]:
				inOrder = False
				startAdd = i
				res = 'no'
	elif i == size - 1:
		if startAdd == 0:
			res = 'yes'
			endAdd = i
			break
		elif a[i] >= a[startAdd - 1]:
			res = 'yes'
			endAdd = i
			break
		else:
			break
	elif a[i] < a[i + 1]:
		if startAdd == 0:
			if a[startAdd] <= a[i + 1]:
				res = 'yes'
				endAdd = i
				break
			else:
				break
		elif a[startAdd] <= a[i + 1] and a[i] >= a[startAdd - 1]:
			res = 'yes'
			endAdd = i
			break
		else:
			break
if res == 'yes':
	if a[endAdd:] == sorted(a[endAdd:]):
		print(res)
		print(startAdd + 1, endAdd + 1)
	else:
		print('no')
else:
	print(res)


z = list(input())
x = list(map(int, input().split()))
c = sorted(x)
test = []
if x == c:
	print('yes')
	print(1, 1)
	exit()
for i in range(len(x)):
	if x[i] != c[i]:
		test.append(i)
a = x[test[0]:test[-1] + 1]
a.reverse()
b = a.copy()
b.sort()
if a == b:
	print('yes')
	print(test[0] + 1, test[-1] + 1)
else:
	print('no')


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	temp = sorted(a)
	if temp == a:
		print('yes')
		print(1, 1)
		return
	low = -1
	high = -1
	for x in range(n):
		if a[x] != temp[x]:
			if low == -1:
				low = x
			high = x
	boss = a[low:high + 1]
	boss.reverse()
	if a[:low] + boss + a[high + 1:] == temp:
		print('yes')
		print(low + 1, high + 1)
	else:
		print('no')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
num = int(input())
array = input()
array = [int(x) for x in array.split()]

def check_increase_array(array, N):
	i = 0
	while i < N - 1 and array[i] <= array[i + 1]:
		i += 1
	if i == N - 1:
		return True
	else:
		return False
if check_increase_array(array, num) == True:
	print('yes')
	print('1 1')
	sys.exit()
i = 0
while i < num - 1 and array[i] < array[i + 1]:
	i += 1
j = num - 1
while j > 0 and array[j] > array[j - 1]:
	j -= 1

def swap_array(array, i, j):
	while i < j:
		(array[i], array[j]) = (array[j], array[i])
		i += 1
		j -= 1
	return array
array = swap_array(array, i, j)
if check_increase_array(array, num) == True:
	print('yes')
	print(str(i + 1) + ' ' + str(j + 1))
	sys.exit()
print('no')


def main():
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n - 1):
		if a[i] > a[i + 1]:
			for j in range(i, n - 1):
				if a[j] < a[j + 1]:
					altered = a[:i] + a[i:j + 1][::-1] + a[j + 1:]
					for k in range(n - 1):
						if altered[k] > altered[k + 1]:
							return 'no'
					return 'yes' + '\n' + f'{i + 1} {j + 1}'
			if a[i - 1] <= a[-1]:
				return 'yes' + '\n' + f'{i + 1} {n}'
			else:
				return 'no'
	return 'yes' + '\n' + '1 1'
print(main())


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i = 0
r = 0
while i < n - 1:
	if a[i] > a[i + 1]:
		r += 1
		start = i
		while i < n - 1 and a[i] > a[i + 1]:
			i += 1
		if i == n - 2 and a[i] > a[i + 1]:
			end = i + 1
		else:
			end = i
	else:
		i += 1
if a == b:
	print('yes')
	print(1, 1)
elif r == 1:
	a = a[:start] + a[start:end + 1][::-1] + a[end + 1:]
	if a == b:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
st = 0
en = 0
for i in range(n):
	if a[i] != b[i]:
		st = i
		break
for i in range(n):
	if a[n - i - 1] != b[n - i - 1]:
		en = n - 1 - i
		break
z = a[st:en + 1]
z = z[::-1]
b = b[st:en + 1]
if b == z:
	print('yes')
	print(st + 1, en + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
sorted_list = sorted(a)
count = 0
(beg_seg, end_seg) = (0, 0)
result = 'no'
for i in range(n):
	if a[i] != sorted_list[i]:
		beg_seg = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != sorted_list[i]:
		end_seg = i
		break
a[beg_seg:end_seg + 1] = reversed(a[beg_seg:end_seg + 1])
if sorted_list[beg_seg:end_seg + 1] == a[beg_seg:end_seg + 1]:
	result = 'yes'
print(result)
if result == 'yes':
	print('%d %d' % (beg_seg + 1, end_seg + 1))


def reverseArray(A, start, end):
	lst = []
	lst = A[0:start]
	for i in range(end, start - 1, -1):
		lst.append(A[i])
	for j in range(end + 1, len(A)):
		lst.append(A[j])
	return lst
n = int(input())
A = list(map(int, input().split()))
A_sorted = sorted(A, reverse=False)
l = n - 1
r = 0
for i in range(len(A)):
	if A[i] != A_sorted[i]:
		l = i
		break
for j in range(len(A) - 1, -1, -1):
	if A[j] != A_sorted[j]:
		r = j
		break
if l == n - 1 and r == 0:
	print('yes')
	print('1 1')
else:
	flag = True
	A = reverseArray(A, l, r)
	for k in range(len(A)):
		if A[k] != A_sorted[k]:
			flag = False
			break
	if flag == True:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
pos = []
if b == a:
	print('yes')
	print(1, 1)
else:
	for i in range(n):
		if a[i] != b[i]:
			pos.append(i)
	m = len(pos)
	a[pos[0]:pos[m - 1] + 1] = a[pos[0]:pos[m - 1] + 1][::-1]
	if a == b:
		print('yes')
		print(pos[0] + 1, pos[m - 1] + 1)
	else:
		print('no')


def inpNum():
	return int(input())

def inpNums():
	return map(int, input().split())

def inpList():
	return list(map(int, input().split()))
n = inpNum()
ai = inpList()
ans = []
bi = ai.copy()
bi.sort()
(first, last) = (None, None)
for i in range(n):
	if ai[i] != bi[i]:
		if first == None:
			first = i
			last = i
		else:
			last = i
if first == None:
	print('yes')
	print(1, 1)
elif first != None and list(reversed(ai[first:last + 1])) == bi[first:last + 1]:
	print('yes')
	print(first + 1, last + 1)
else:
	print('no')


def is_sorted(array):
	for i in range(len(array) - 1):
		if array[i] > array[i + 1]:
			return False
	return True

def reverse(array, start, end):
	new_array = array.copy()
	while start < end:
		(new_array[start], new_array[end]) = (new_array[end], new_array[start])
		start += 1
		end -= 1
	return new_array
n = input()
array = list(map(int, input().split()))
if is_sorted(array):
	print('yes')
	print('1 1')
else:
	i = 0
	while i < len(array) - 1 and array[i] < array[i + 1]:
		i += 1
	j = i + 1
	while j < len(array) - 1 and array[j] > array[j + 1]:
		j += 1
	if is_sorted(reverse(array, i, j)):
		print('yes')
		print(f'{i + 1} {j + 1}')
	else:
		print('no')


n = int(input())
a = [*map(int, input().split())]
a = [min(a)] + a + [max(a)]
high = -1
for i in range(1, n + 1):
	if a[i] > a[i - 1] and a[i] > a[i + 1]:
		if high == -1:
			high = i
		else:
			print('no')
			quit()
low = -1
for i in range(1, n + 1):
	if a[i] < a[i - 1] and a[i] < a[i + 1]:
		if low == -1:
			low = i
		else:
			print('no')
			quit()
if high == -1 and low == -1:
	print('yes')
	print(1, 1)
	quit()
if high > low:
	print('no')
	quit()
if a[high - 1] > a[low] or a[low + 1] < a[high]:
	print('no')
	quit()
print('yes')
print(high, low)


def solve(A):
	start = len(A)
	for i in range(len(A) - 1):
		if A[i] > A[i + 1]:
			start = i
			break
	end = start
	while end < len(A) - 1 and A[end] > A[end + 1]:
		end += 1
	A = A[:start] + A[start:end + 1][::-1] + A[end + 1:]
	for i in range(len(A) - 1):
		if A[i] > A[i + 1]:
			return ('No', start, end)
	return ('Yes', start, end)
x = input()
A = list(map(int, input().split()))
(ans, s, e) = solve(A)
if ans == 'No':
	print('no')
else:
	print('yes')
	if s == e:
		s = e = 0
	print(s + 1, e + 1)


def func():
	if A == B:
		return [0, 0, 'yes']
	start = 0
	end = 0
	for k in range(n):
		if A[k] != B[k]:
			start = k
			break
	for k in range(n - 1, -1, -1):
		if A[k] != B[k]:
			end = k
			break
	if start < end:
		C = A[:start] + A[start:end + 1][::-1] + A[end + 1:]
		if C == B:
			return [start, end, 'yes']
	return [0, 0, 'no']
n = int(input())
A = list(map(int, input().split()))
B = sorted(A)
ret = func()
if ret[2] == 'yes':
	print('yes')
	print(ret[0] + 1, ret[1] + 1)
else:
	print('no')


import sys
import os

def get_int():
	return map(int, input().split())

def get_array():
	return list(map(int, input().split()))

def str_replacer(old_str, new_str, index):
	if index in range(len(old_str)):
		return old_str[:index] + new_str + old_str[index + 1:]
	else:
		return old_str
if os.environ.get('DEBUGSTER_PYTHON'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
n = int(input())
data = get_array()
s = -1
for i in range(n - 1):
	if data[i] > data[i + 1]:
		s = i
		break
if s == -1:
	print('yes\n1 1')
else:
	f = -1
	for i in range(s, n - 1):
		if data[i] < data[i + 1]:
			f = i
			break
	if f == -1:
		f = n - 1
	m = int((s + f) / 2)
	i = s
	j = f
	while i <= m:
		(data[i], data[j]) = (data[j], data[i])
		i += 1
		j -= 1
	yes = True
	for i in range(n - 1):
		if data[i] > data[i + 1]:
			yes = False
			break
	if yes:
		print(f'yes\n{s + 1} {f + 1}')
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
temp = []
for i in range(n):
	temp.append(l[i])
if n != 1:
	a = 0
	b = 0
	if l[0] > l[1]:
		b = 1
	else:
		a = 1
	count = 0
	t = 0
	done = 0
	for i in range(n - 1):
		if done != 1:
			if a == 1:
				if l[i] > l[i + 1]:
					a = 0
					b = 1
					count = 1
					t = i
			elif l[i] < l[i + 1]:
				done = 1
			else:
				if i == 0:
					t = i
				count += 1
	count += 1
	x = []
	for i in range(t, t + count):
		x.append(l[i])
	x.sort()
	for i in range(t, t + count):
		l[i] = x[i - t]
	temp.sort()
	done = 0
	for i in range(n):
		if l[i] != temp[i]:
			done = 1
			break
	if done == 0:
		print('yes')
		print(t + 1, end=' ')
		print(t + count)
	else:
		print('no')
else:
	print('yes')
	print(1, end=' ')
	print(1)


n = int(input())
l = list(map(int, input().split()))
e = 0
f = 0
g = 0
p = -1
for i in range(len(l)):
	if l[i] < p and g == 2:
		g = 3
		break
	if g == 1 and l[i] > p:
		f = i - 1
		g = 2
	if l[i] < p and g != 1:
		e = i - 1
		g = 1
	p = l[i]
if g == 0:
	print('yes')
	print(1, 1)
	exit()
if g == 3:
	print('no')
	exit()
if g == 1:
	if e == 0:
		print('yes')
		print(e + 1, len(l))
	elif l[e - 1] < l[len(l) - 1]:
		print('yes')
		print(e + 1, len(l))
	else:
		print('no')
	exit()
if g == 2:
	if e - 1 > -1 and f + 1 < len(l):
		if l[e - 1] < l[f] and l[e] < l[f + 1]:
			print('yes')
			print(e + 1, f + 1)
		else:
			print('no')
		exit()
	if e - 1 == -1:
		if l[e] < l[f + 1]:
			print('yes')
			print(e + 1, f + 1)
		else:
			print('no')
		exit()


def read_input():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	return (n, a)

def do_sort(n, a):
	start = None
	end = None
	i = 0
	while i < n - 1 and a[i] < a[i + 1]:
		i += 1
	if i == n - 1:
		return (0, 0)
	start = i
	while i < n - 1 and a[i] > a[i + 1]:
		i += 1
	end = i
	if i == n - 1:
		if a[end] < a[start - 1]:
			return (None, None)
		return (start, end)
	a[start:end + 1] = reversed(a[start:end + 1])
	for i in range(0, n - 1):
		if a[i] > a[i + 1]:
			return (None, None)
	return (start, end)

def main():
	(n, a) = read_input()
	result = do_sort(n, a)
	if result != (None, None):
		print('yes')
		print('{} {}'.format(result[0] + 1, result[1] + 1))
	else:
		print('no')
main()


def rev(a, l, r):
	while l < r:
		(a[l], a[r]) = (a[r], a[l])
		l += 1
		r -= 1
n = int(input())
a = list(map(int, input().strip().split()))
b = sorted(a)
l = -1
r = -1
for i in range(n):
	if a[i] != b[i]:
		l = i
		break
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		r = i
		break
rev(a, l, r)
if a == b:
	print('yes')
	if l == -1 and r == -1:
		print(1, 1)
	else:
		print(l + 1, r + 1)
else:
	print('no')


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def chars():
	s = cin()
	return list(s[:len(s) - 1])
(n,) = mp()
a = mp()
start = end = -1
f = 0
for i in range(1, n):
	if a[i] - a[i - 1] < 0:
		if f:
			cout('no\n')
			exit(0)
		if start == -1:
			start = i
			end = i
		else:
			end = i
	elif start > -1 and end > -1:
		f = 1
if start == -1 and end == -1:
	cout('yes\n1 1')
else:
	start -= 1
	if (end == n - 1 or a[start] < a[end + 1]) and (start == 0 or a[end] > a[start - 1]):
		cout('yes\n' + str(start + 1) + ' ' + str(end + 1))
	else:
		cout('no\n')


def decSeq(L):
	(l, r) = (0, 0)
	for i in range(len(L) - 1):
		if L[i + 1] < L[i]:
			l = i
			break
	try:
		for i in range(l, len(L)):
			r = i
			if L[i + 1] > L[i]:
				break
	except IndexError:
		r = len(L) - 1
	return (l, r)
(n, arr) = (input(), list(map(int, input().split())))
(l, r) = decSeq(arr)
if sorted(arr) == arr:
	print('yes')
	print(1, 1)
elif sorted(arr) == arr[:l] + sorted(arr[l:r + 1]) + arr[r + 1:]:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


from sys import stdin, stdout
input = stdin.readline
t = 1
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	start = -1
	end = n - 1
	for i in range(n - 1):
		if a[i + 1] < a[i]:
			if start == -1:
				start = i
		elif start != -1:
			end = i
			break
	a[start:end + 1] = a[start:end + 1][::-1]
	if a == sorted(a):
		print('yes')
		if start == -1:
			start = end = 0
		print(start + 1, end + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
count = 0
first = 0
last = n - 1
new = []
for i in range(n - 1):
	if count == 0 and a[i] > a[i + 1]:
		count = 1
		first = i
	if count == 0 and a[i] < a[i + 1]:
		new.append(a[i])
	if count == 1 and a[i] < a[i + 1]:
		last = i
		break
R = a[first:last + 1]
R.reverse()
for i in R:
	new.append(i)
B = a[last + 1:n]
for i in B:
	new.append(i)
if a == sorted(a):
	print('yes')
	print(1, 1)
elif sorted(a) == new:
	print('yes')
	print(first + 1, last + 1)
else:
	print('no')


n = int(input())
list = [int(i) for i in input().split()]
temp = list.copy()
temp.sort()
if temp == list:
	print('yes')
	print(1, 1)
	exit()
for i in range(n - 1):
	if list[i] > list[i + 1]:
		p = i
		j = i
		while j < n - 1 and list[j] > list[j + 1]:
			j += 1
		q = j
		break
if p == 0:
	final = list[q::-1] + list[q + 1:n]
else:
	final = list[0:p] + list[q:p - 1:-1] + list[q + 1:n]
if final == temp:
	print('yes')
	print(p + 1, q + 1)
	exit()
else:
	print('no')


n = input()
n = int(n)
x = [int(i) for i in input().split()]
l = []
for i in range(n):
	l.append((x[i], i))
y = sorted(l)
if y == l:
	print('yes')
	print('1 1')
else:
	o = 0
	a = None
	b = None
	i = 0
	while i < n - 1:
		if not y[i][1] == l[i][1]:
			o += 1
		if y[i][1] == y[i + 1][1] + 1:
			a = l[i][1]
			b = l[i + 1][1]
			i += 1
			try:
				while y[i][1] == y[i + 1][1] + 1:
					b = l[i + 1][1]
					i += 1
			except:
				pass
		i += 1
	if o == 1:
		print('yes')
		print(a + 1, end=' ')
		print(b + 1)
	else:
		print('no')


n = int(input())
a = [int(i) for i in input().split()]
b = [i for i in a]
b.sort()
c = ''
fl = []
for i in range(n):
	if a[i] == b[i]:
		c = c + '1'
	else:
		c = c + '0'
p = c.find('0')
if p == -1:
	p = 0
q = c.rfind('0')
if q == -1:
	q = 0
fl.extend(a[:p])
f = a[p:q + 1]
fl.extend(f[::-1])
fl.extend(a[q + 1:])
if b == fl:
	print('yes')
	print(p + 1, q + 1)
else:
	print('no')


from sys import stdin
n = int(stdin.readline())
nums = list(map(int, stdin.readline().rstrip().split(' ')))
has_seg = False
cur = nums[0]
seg_start = -1
seg_end = -1
for i in range(1, len(nums)):
	if nums[i] <= nums[i - 1]:
		if seg_start == -1:
			seg_start = i - 1
		elif seg_end != i - 1:
			print('no')
			exit()
		seg_end = i
	elif seg_start != -1:
		if nums[seg_start] > nums[i]:
			print('no')
			exit()
if seg_end == len(nums) - 1 and nums[seg_start - 1] > nums[seg_end]:
	print('no')
else:
	print('yes')
	if seg_start == -1 and seg_end == -1:
		print('{} {}'.format(1, 1))
	else:
		print('{} {}'.format(seg_start + 1, seg_end + 1))


n = int(input())
nums = [int(i) for i in input().split()]
start = -1
end = -1
inv = False
for i in range(1, n):
	if nums[i] < nums[i - 1]:
		if start == -1:
			start = i
			inv = True
		end = i + 1
	elif not inv:
		continue
	else:
		break
if start == -1 and end == -1:
	print('yes\n1 1')
else:
	nums = nums[:start - 1] + nums[start - 1:end][::-1] + nums[end:]
	if nums == sorted(nums):
		print('yes\n' + str(start) + ' ' + str(end))
	else:
		print('no')


n = int(input())
s = [int(x) for x in input().split()]
w = sorted(s)
k = -1
for i in range(n):
	if s[i] != w[i] and k == -1:
		k = i
	if s[i] != w[i]:
		l = i
if k == -1:
	print('yes')
	print('1 1')
else:
	q = [0] * n
	for i in range(0, k):
		q[i] = s[i]
	for i in range(k, l + 1):
		q[i] = s[l - i + k]
	for i in range(l + 1, n):
		q[i] = s[i]
	if q == w:
		print('yes')
		print(k + 1, l + 1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
(cnt, li, ri) = (0, 1, 1)
for i in range(n - 1):
	if arr[i] >= arr[i + 1]:
		if cnt == 0:
			li = i + 1
			cnt += 1
	elif cnt > 0:
		ri = i + 1
		break
if cnt == 0:
	print('yes')
	print(li, ri)
else:
	if ri == 1:
		ri = n
	arr[li - 1:ri] = sorted(arr[li - 1:ri])
	if arr == sorted(arr):
		print('yes')
		print(li, ri)
	else:
		print('no')


from sys import stdin, stdout
from collections import defaultdict
import heapq as hq

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()
INF = 10000000000.0
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
s = -1
e = n
b = sorted(a)
if b == a:
	print('yes')
	print('1 1')
else:
	for i in range(n - 1):
		if a[i] > a[i + 1] and s == -1 and (e == n):
			s = i
		if a[i] < a[i + 1] and s != -1 and (e == n):
			e = i
	if e == n:
		e = e - 1
	part = a[s:e + 1]
	part.reverse()
	new = a[:s] + part + a[e + 1:]
	if b == new:
		print('yes')
		print(s + 1, e + 1)
	else:
		print('no')


n = int(input())
a = [int(i) for i in input().split()]
A = list(set(a))
A.sort()
s = [index for (index, elem) in enumerate(A) if elem != a[index]]
r = 0
x = 0
if a == A:
	print('yes')
	print(1, 1)
	x = 1
else:
	(l, r) = (s[0], s[-1])
	if a[:l] + a[l:r + 1][::-1] + a[r + 1:] == A and x == 0:
		print('yes')
		print(l + 1, r + 1)
		x = 1
if x == 0:
	print('no')


def main():
	n = int(input())
	array = list(map(int, input().split()))
	sorted_array = sorted(array)
	start = 0
	end = 0
	for i in range(n):
		if array[i] != sorted_array[i]:
			start = i
			break
	for i in range(n - 1, -1, -1):
		if array[i] != sorted_array[i]:
			end = i
			break
	j = end
	for i in range(start, end + 1):
		if array[i] != sorted_array[j]:
			print('no')
			exit(0)
		else:
			j -= 1
	print('yes')
	print('{} {}'.format(start + 1, end + 1))
main()


n = int(input())
arr = list(map(int, input().split()))
l = 0
r = n
for i in range(0, n - 1):
	if arr[i] > arr[i + 1]:
		l = i
		break
for i in range(l, n - 1):
	if arr[i] < arr[i + 1]:
		r = i
		break
seq = arr[l:r + 1]
ans = arr[:l] + seq[::-1] + arr[r + 1:]
arr.sort()
if ans == arr:
	print('yes')
	if r == n:
		print(l + 1, n)
	else:
		print(l + 1, r + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
k = 0
i1 = i2 = -1
flag = True
for i in range(n - 1):
	if a[i] > a[i + 1] and k == 0:
		k = 1
		i1 = i
	elif a[i] < a[i + 1] and k == 1:
		i2 = i
		break
if i2 == -1 and i1 != -1:
	i2 = n - 1
l2 = []
if i1 == -1 and i2 == -1:
	i1 = i2 = 0
for i in range(i1):
	l2.append(a[i])
for i in range(i2, i1 - 1, -1):
	l2.append(a[i])
for i in range(i2 + 1, n):
	l2.append(a[i])
for i in range(n - 1):
	if l2[i] > l2[i + 1]:
		flag = False
		break
if flag == True:
	print('yes')
	print(i1 + 1, i2 + 1)
else:
	print('no')


n = input()
thelist = input()
final = []
now = thelist.split()
for item in now:
	final.append(int(item))
begin = sorted(final)
indices = []
i = 0
length = len(final)
while i < length:
	if final[i] != begin[i]:
		indices.append(i)
	i += 1
all = len(indices)
if len(indices) != 0:
	x = indices[0]
	y = indices[all - 1]
	switched = []
	p = 0
	while p < x:
		switched.append(final[p])
		p += 1
	j = 0
	while j <= y - x:
		switched.append(final[y - j])
		j += 1
	q = y + 1
	while q < length:
		switched.append(final[q])
		q += 1
	switchable = 'yes'
	z = 0
	while z < len(begin):
		if switched[z] != begin[z]:
			switchable = 'no'
			break
		z += 1
	if switchable == 'yes':
		print('yes')
		print(x + 1, y + 1)
	else:
		print('no')
else:
	print('yes')
	print('1 1')


n = int(input())
l = list(map(int, input().split()))
a = l.copy()
a.sort()
b = []
p = 0
if l == a:
	print('yes')
	print(1, 1, sep=' ')
else:
	j = 0
	r = 0
	k = 'n'
	for i in range(n):
		if l[i] != a[i] and (j == 0 or r == 0 or r == 1):
			q = i
			b.append(q)
			j = 1
			k = 'y'
		elif l[i] == a[i] and r == 0 and (k == 'y'):
			p = i
			r = 1
		elif l[i] == a[i] and r == 1:
			break
	z = len(b)
	if z % 2 == 0 and p == (z + 1) // 2 and (p < max(b)):
		b.append(p)
		z = len(b)
		b.sort()
		x = b[0]
		y = b[z - 1]
		c = l[x:y + 1]
		c.reverse()
		d = l[0:x] + c + l[y + 1:n]
		if d == a:
			print('yes')
			print(b[0] + 1, b[z - 1] + 1, sep=' ')
		else:
			print('no')
	else:
		z = len(b)
		b.sort()
		x = b[0]
		y = b[z - 1]
		c = l[x:y + 1]
		c.reverse()
		d = l[0:x] + c + l[y + 1:n]
		if d == a:
			print('yes')
			print(b[0] + 1, b[z - 1] + 1, sep=' ')
		else:
			print('no')


n = int(input())
arr = list(map(int, input().split()))
xx = sorted(arr)
if arr == xx:
	print('yes')
	print(1, 1)
else:
	(start, end) = (0, 0)
	for i in range(0, n):
		if xx[i] != arr[i]:
			start = i
			break
	for j in range(n - 1, -1, -1):
		if xx[j] != arr[j]:
			end = j
			break
	arr[start:end + 1] = arr[start:end + 1][::-1]
	if xx == arr:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
l = 0
c = []
for i in range(len(a) - 1):
	if a[i] > a[i + 1]:
		l += 1
if l == 0:
	print('yes')
	print('1' + ' ' + '1')
else:
	for i in range(len(a) - 1):
		if a[i + 1] <= a[i]:
			c.append(i)
			if a[i] < a[i + 1]:
				c.append(i)
				break
	c.append(c[-1] + 1)
	a[c[0]:c[-1] + 1] = reversed(a[c[0]:c[-1] + 1])
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			print('no')
			exit()
	print('yes')
	print(str(c[0] + 1) + ' ' + str(c[-1] + 1))


n = int(input())
A = list(map(int, input().split()))
l = -1
for i in range(n - 1):
	if A[i] > A[i + 1]:
		l = i
		break
if l < 0:
	print('yes')
	print(1, 1)
else:
	r = n - 1
	for i in range(l + 1, n - 1):
		if A[i] < A[i + 1]:
			r = i
			break
	A[l:r + 1] = reversed(A[l:r + 1])
	for i in range(max(0, l - 1), n - 1):
		if A[i] > A[i + 1]:
			print('no')
			break
	else:
		print('yes')
		print(l + 1, r + 1)


def reverse(arr, left, right):
	while left < right:
		t = arr[left]
		arr[left] = arr[right]
		arr[right] = t
		left += 1
		right -= 1
n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b.sort()
left = -1
right = -1
for i in range(n):
	if a[i] != b[i]:
		left = i
		break
if left == -1:
	print('yes')
	print(1, 1)
	return
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		right = i
		break
reverse(a, left, right)
for i in range(n):
	if a[i] != b[i]:
		print('no')
		return
print('yes')
print(left + 1, right + 1)


n = int(input())
a = list(map(int, input().split()))
a_sort = list(a)
a_sort.sort()
index = []
for i in range(n):
	if a[i] != a_sort[i]:
		index.append(i)
if len(index) == 0:
	print('yes')
	print('1 1')
else:
	section = []
	for i in range(index[0], index[-1] + 1, 1):
		section.append(a[i])
	section_rev = [0] * len(section)
	for i in range(len(section)):
		section_rev[len(section) - 1 - i] = section[i]
	x = 0
	for i in range(index[0], index[-1] + 1):
		a[i] = section_rev[x]
		x += 1
	out = True
	for i in range(n):
		if a[i] != a_sort[i]:
			out = False
			break
	if out:
		print('yes')
		print(index[0] + 1, index[-1] + 1)
	else:
		print('no')


n = int(input())
original = list(map(int, input().split()))
copy = original[:]
copy.sort()
index = []
for i in range(len(original)):
	if original[i] != copy[i]:
		index.append(i)
if index == []:
	print('yes')
	print(1, 1)
else:
	for i in range(index[0], index[len(index) - 1] + 1):
		if i != index[len(index) - 1]:
			if original[i] < original[i + 1]:
				c = 'no'
				break
			else:
				c = 'yes'
				a = [index[0], index[len(index) - 1]]
		elif original[i] > original[i - 1]:
			c = 'no'
			break
		else:
			c = 'yes'
			a = [index[0], index[len(index) - 1]]
	if c == 'yes':
		print(c)
		for i in a:
			print(i + 1, end=' ')
	else:
		print(c)


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
n = iinput()
a = rlinput()
i = 1
while i < n and a[i - 1] < a[i]:
	i += 1
j = i
while j < n and a[j - 1] > a[j]:
	j += 1
temp = a[:i - 1] + a[i - 1:j][::-1] + a[j:]
if temp == sorted(a):
	print('yes')
	if i != j:
		print(i, j)
	else:
		print(1, 1)
else:
	print('no')


def foo():
	input()
	arr = [int(n) for n in input().split()]
	segment = []
	segment_completed = False
	for i in range(0, len(arr)):
		if i != 0 and arr[i] < arr[i - 1] or (i != len(arr) - 1 and arr[i] > arr[i + 1]):
			if segment_completed:
				return
			if i != len(arr) - 1 and arr[i] < arr[i + 1]:
				segment_completed = True
			segment.append(i)
	if len(segment) == 0:
		segment.append(0)
	if segment[0] != 0 and arr[segment[-1]] < arr[segment[0] - 1] or (segment[-1] != len(arr) - 1 and arr[segment[0]] > arr[segment[-1] + 1]):
		return
	else:
		return (segment[0] + 1, segment[-1] + 1)
ans = foo()
if ans is None:
	print('no')
else:
	print('yes')
	print(*ans)


n = int(input())
ai = [-1] + list(map(int, input().split()))
ai2 = [str(int(ai[i] > ai[i - 1])) for i in range(1, n + 1)]
ai2 = ''.join(ai2)
num = ai2.find('0')
num2 = num + 1 + ai2[num + 1:].find('1')
num3 = ai2[num2 + 1:].find('0')
if num == -1:
	print('yes')
	print(1, 1)
elif num2 == num:
	num2 = n
	ai = ai[:num] + list(reversed(ai[num:num2 + 1])) + ai[num2 + 1:]
	ai2 = [str(int(ai[i] > ai[i - 1])) for i in range(1, n + 1)]
	ai2 = ''.join(ai2)
	if ai2.find('0') == -1:
		print('yes')
		print(num, num2)
	else:
		print('no')
elif num3 == -1:
	ai = ai[:num] + list(reversed(ai[num:num2 + 1])) + ai[num2 + 1:]
	ai2 = [str(int(ai[i] > ai[i - 1])) for i in range(1, n + 1)]
	ai2 = ''.join(ai2)
	if ai2.find('0') == -1:
		print('yes')
		print(num, num2)
	else:
		print('no')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
init = -1
count = 0
b = []
for i in range(len(a) - 1):
	if a[i] > a[i + 1]:
		if init == -1:
			init = i + 1
			count = i + 2
			continue
		count += 1
	elif a[i] <= a[i + 1] and init != -1:
		b.append(init)
		b.append(count)
		break
e = 0
if len(b) == 0:
	if init == -1 and count == 0:
		print('yes')
		print(1, 1)
		e = 1
	else:
		b.append(init)
		b.append(count)
	d = a[init - 1:count]
	d.reverse()
	d = a[0:init - 1] + d + a[count:]
	a.sort()
	if d == a and e == 0:
		print('yes')
		print(init, count)
	elif e == 0:
		print('no')
else:
	d = a[init - 1:count]
	d.reverse()
	d = a[0:init - 1] + d + a[count:]
	a.sort()
	if d == a:
		print('yes')
		print(init, count)
	else:
		print('no')


n = int(input())
var = [int(x) for x in input().split()]
var2 = sorted(var)
firstDiffer = 0
for index in range(0, n):
	if var[index] != var2[index]:
		firstDiffer = index
		break
lastDiffer = firstDiffer
for index1 in range(n - 1, 0, -1):
	if var[index1] != var2[index1]:
		lastDiffer = index1
		break
var[firstDiffer:lastDiffer + 1] = var[firstDiffer:lastDiffer + 1][::-1]
if var == var2:
	print('yes')
	print(firstDiffer + 1, lastDiffer + 1, end=' ')
else:
	print('no')


n = int(input())
a = [int(i) for i in input().split()]
b = sorted(a)
count = 0
j = n - 1
rng = []
for i in range(0, n):
	if a[i] != b[i]:
		count += 1
		if count > 1:
			break
		while j > i:
			if a[j] != b[j]:
				break
			j -= 1
		a[i:j + 1] = reversed(a[i:j + 1])
		rng = [i + 1, j + 1]
if count == 1:
	print('yes')
	print(rng[0], rng[1])
elif count == 0:
	print('yes')
	print(1, 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = [i for i in a]
b.sort()
(start, end) = (-1, 0)
for i in range(n):
	if a[i] != b[i]:
		if start == -1:
			start = i
		end = i
if start != -1:
	z = a[start:end + 1]
	z.reverse()
	a = a[:start] + z + a[end + 1:]
	if a == b:
		print('yes')
		print(str(start + 1) + ' ' + str(end + 1))
	else:
		print('no')
else:
	print('yes')
	print('1 1')


import atexit
import io
import sys
import bisect
_I_B = sys.stdin.read().splitlines()
input = iter(_I_B).__next__
_O_B = io.StringIO()
sys.stdout = _O_B

@atexit.register
def write():
	sys.__stdout__.write(_O_B.getvalue())

def main():
	n = int(input())
	a = list(map(int, input().split()))
	i = 1
	rs = 0
	while i < n:
		if a[i] < a[i - 1]:
			rs += 1
			s = i - 1
			while i < n and a[i] < a[i - 1]:
				i += 1
			e = i - 1
		if rs > 1:
			print('no')
			exit(0)
		i += 1
	if rs == 0:
		print('yes')
		print(1, 1)
	else:
		ta = a[0:s] + a[s:e + 1][::-1] + a[e + 1:]
		if ta == sorted(a):
			print('yes')
			print(s + 1, e + 1)
		else:
			print('no')
main()


n = int(input())
L = list(map(int, input().split()))
(a, b, c) = (0, 0, False)
for i in range(n - 1):
	if L[i] > L[i + 1] and (not c):
		a = i + 1
		c = True
	if L[i] < L[i + 1] and c:
		b = i + 1
		break
if b == 0:
	b = n
print('yes\n1 1' if L == sorted(L) else 'yes\n' + str(a) + ' ' + str(b) if L[:a - 1] + sorted(L[a - 1:b]) + L[b:] == sorted(L) else 'no')


n = int(input())
li = list(map(int, input().split()))
ind = None
for i in range(n - 1):
	if li[i] > li[i + 1]:
		ind = i
		break
if ind is None:
	print('yes\n1 1')
	exit()
ind1 = None
for i in range(ind, n - 1):
	if li[i] < li[i + 1]:
		ind1 = i
		break
f = 1
if ind1 is None:
	li2 = li[:ind] + li[ind:][::-1]
else:
	li2 = li[:ind] + li[ind:ind1 + 1][::-1] + li[ind1 + 1:]
for i in range(1, n):
	if li2[i - 1] <= li2[i]:
		f += 1
if f == n:
	if ind1 is None:
		ind1 = n - 1
	print(f'yes\n{ind + 1} {ind1 + 1}')
else:
	print('no')


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass

def _reverse(arr, left, right):
	n = len(arr)
	return arr[:left] + arr[-n + right:-n + left - 1:-1] + arr[right + 1:]

def check(arr):
	n = len(arr)
	for i in range(1, n):
		if arr[i] < arr[i - 1]:
			return False
	return True
t = int(input())
arr = [[-1 * 10 ** 10, 0], [-1 * 10 ** 10 + 1, 1]]
val = []
_number = 2
for i in input().split():
	val.append(int(i))
	arr.append([int(i), _number])
	_number += 1
arr.append([10 ** 10, t + 2])
arr.append([10 ** 10 + 1, t + 3])
t += 4
flag = True
for i in range(1, t):
	if arr[i] < arr[i - 1]:
		flag = False
if flag:
	print('yes\n1 1')
	exit(0)
arr.sort()
left = 1
for i in range(1, t):
	if arr[i - 1][1] + 1 == arr[i][1]:
		left = i
	else:
		break
right = t - 2
for i in range(t - 2, 0, -1):
	if arr[i + 1][1] - 1 == arr[i][1]:
		right = i
	else:
		break
(left, right) = (arr[right - 1][1] - 2, arr[left + 1][1] - 2)
flag = False
if left <= right:
	val = _reverse(val, left, right)
	flag = check(val)
if not flag:
	print('no')
else:
	print('yes\n%d %d' % (left + 1, right + 1))


import sys

def fn(n, a):
	b = a.copy()
	b.sort()
	if b == a:
		print('yes')
		print(1, 1)
		return None
	i = 0
	k = []
	while i < len(a) - 1:
		if a[i + 1] < a[i]:
			k.append(i)
			i = i + 1
		else:
			i = i + 1
	k.append(k[len(k) - 1] + 1)
	c = a[k[0]:k[len(k) - 1] + 1]
	c.reverse()
	m = 0
	for j in k:
		if m < len(c):
			a[j] = c[m]
			m = m + 1
	if a == b:
		print('yes')
		print(k[0] + 1, k[len(k) - 1] + 1)
		return None
	else:
		print('no')
		return None
input = sys.stdin.read()
data = list(map(int, input.split()))
n = data[0]
a = data[1:]
fn(n, a)


n = int(input())
sp = list(map(int, input().split()))
q = sorted(sp)
l = -1
r = -1
i = 0
sp.append(0)
q.append(0)
while i < n and sp[i] == q[i]:
	i += 1
if i != n:
	l = i
sp = [0] + sp[:-1]
q = [0] + q[:-1]
i = n
while i > 0 and sp[i] == q[i]:
	i -= 1
if i != 0:
	r = i
if l == r == -1:
	print('yes')
	print(1, 1)
else:
	sp = sp[1:]
	q = q[1:]
	sp = sp[:l] + sp[l:r][::-1] + sp[r:]
	if sp == q:
		print('yes')
		print(l + 1, r)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
a.insert(0, 0)
a.insert(len(a), max(a) + 1)
cnt = 0
i = 0
j = 0
check = True
if n == 2:
	if a[1] < a[2]:
		print('yes')
		print(1, 1)
	else:
		print('yes')
		print(1, 2)
else:
	step = 1
	while step < len(a) - 1:
		if a[step] > a[step + 1] and a[step] > a[step - 1]:
			cnt += 1
			if cnt == 2:
				check = False
				break
			i = step
			while step < len(a) - 1 and a[step] > a[step + 1]:
				step += 1
			j = step
		step += 1
	if check:
		if i == 0 and j == 0:
			print('yes')
			print(1, 1)
		elif a[j] > a[i - 1] and a[i] < a[j + 1]:
			print('yes')
			print(i, j)
		else:
			print('no')
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
ls = sorted(arr)
if n == 1 or ls == arr:
	print('yes')
	print(1, 1)
else:
	i = 0
	j = n - 1
	while i < j:
		if arr[i] != ls[i] and arr[j] != ls[j]:
			break
		if arr[i] == ls[i]:
			i += 1
		if arr[j] == ls[j]:
			j -= 1
	if arr[i:j + 1][::-1] == ls[i:j + 1]:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


import sys
from collections import defaultdict
f = sys.stdin
n = int(f.readline())
a = list(map(int, f.readline().split()))
l = None
r = None
for p in range(1, n):
	if a[p - 1] > a[p]:
		if l is None:
			l = p - 1
		r = p
if l is None:
	l = 0
	r = 0
a = a[:l] + list(reversed(a[l:r + 1])) + a[r + 1:]
if a == sorted(a):
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
A = [int(_) for _ in input().split()]
B = sorted(A)
i = 0
s = None
while i < n:
	if A[i] != B[i]:
		s = i
		break
	i += 1
i = n - 1
e = None
while i > -1:
	if A[i] != B[i]:
		e = i
		break
	i -= 1
if e != None and s != None:
	if A[e::-1] == sorted(A[s:e + 1]) and s == 0 or A[e:s - 1:-1] == sorted(A[s:e + 1]):
		print('yes')
		print(s + 1, e + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


import math
n = int(input())
d = list(map(int, input().split()))
sd = sorted(d)
if d == sd:
	print('yes')
	print('1 1')
	exit()
p = 0
q = n - 1
for i in range(n - 1):
	if d[i] != sd[i]:
		p = i
		break
for i in range(n - 1, 0, -1):
	if d[i] != sd[i]:
		q = i
		break
if sd[p:q + 1] != d[p:q + 1][::-1]:
	print('no')
else:
	print('yes')
	print(p + 1, q + 1)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
(i, j) = (0, n - 1)
while i < n and a[i] == b[i]:
	i += 1
if i == n:
	print('yes\n1 1')
else:
	while j >= 0 and a[j] == b[j]:
		j -= 1
	(l, r) = (i + 1, j + 1)
	while i < j:
		(a[i], a[j]) = (a[j], a[i])
		i += 1
		j -= 1
	is_sorted = True
	for i in range(1, n):
		if a[i] < a[i - 1]:
			is_sorted = False
			break
	if is_sorted:
		print('yes')
		print(l, r)
	else:
		print('no')


is_debug = False
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
print(f'a={a}, b={b}', end='|') if is_debug else ''
start_idx = -1
for i in range(0, len(a)):
	if a[i] != b[i]:
		start_idx = i
		break
print(f'start_idx={start_idx}', end='|') if is_debug else ''
end_idx = -1
for i in range(len(a) - 1, -1, -1):
	if a[i] != b[i]:
		end_idx = i
		break
print(f'end_idx={end_idx}', end='|') if is_debug else ''
a1 = a[start_idx:end_idx + 1]
b1 = b[start_idx:end_idx + 1]
a1.reverse()
flag = True
for i in range(0, len(a1)):
	if a1[i] != b1[i]:
		flag = False
		break
print(f'a1={a1}, b1={b1}') if is_debug else ''
if flag:
	print(f'yes')
	if start_idx == -1 and end_idx == -1:
		print(f'1 1')
	else:
		print(f'{start_idx + 1} {end_idx + 1}')
else:
	print(f'no')


n = int(input())
arr = list(map(int, input().rstrip().split()))
if sorted(arr) == arr:
	print('yes')
	print(1, 1)
else:
	prevv = arr[0]
	cnt = 0
	flag = 0
	flag1 = 0
	begin = 0
	end = n - 1
	for i in range(1, n):
		if arr[i] < prevv and cnt == 0:
			cnt = 1
			begin = i - 1
			prevv = arr[i]
		elif arr[i] < prevv:
			prevv = arr[i]
			cnt += 1
		elif cnt != 0 and arr[i] > prevv and (flag == 0):
			prevv = arr[i]
			end = i - 1
			flag = 1
		else:
			prevv = arr[i]
	if True:
		for i in range(end + 1, n - 1):
			if arr[i] > arr[i + 1]:
				flag1 = 1
		if flag1 == 1:
			print('no')
	if begin == 0 and end == n - 1 and (flag1 == 0):
		print('yes')
		print(begin + 1, end + 1)
	elif begin == 0 and end != n - 1 and (flag1 == 0):
		if arr[end + 1] > arr[begin]:
			print('yes')
			print(begin + 1, end + 1)
		else:
			print('no')
	elif begin != 0 and end == n - 1 and (flag1 == 0):
		if arr[begin - 1] < arr[end]:
			print('yes')
			print(begin + 1, end + 1)
		else:
			print('no')
	elif flag1 == 0:
		if arr[begin - 1] < arr[end] and arr[end + 1] > arr[begin]:
			print('yes')
			print(begin + 1, end + 1)
		else:
			print('no')


n = int(input())
a = list(map(int, input().split()))
(z, v) = (0, [])
for i in range(n - 1):
	if a[i] > a[i + 1]:
		v.append(a[i])
		z = 1
	elif z == 1:
		break
if len(v) == 0:
	print('yes')
	print(1, 1)
else:
	q = a.index(v[0])
	w = a.index(v[-1])
	v.append(a[w + 1])
	t = a[:q] + v[::-1] + a[w + 2:]
	a.sort()
	if t == a:
		print('yes')
		print(q + 1, w + 2)
	else:
		print('no')


from sys import stdin, stdout

def solve(a, n):
	sorted_a = sorted(a)
	if a == sorted_a:
		return 'yes\n1 1'
	i = 0
	(left, right) = (0, 0)
	while i < n:
		if a[i] == sorted_a[i]:
			left += 1
		else:
			break
		i += 1
	j = n - 1
	while j > -1:
		if a[j] == sorted_a[j]:
			right += 1
		else:
			break
		j -= 1
	if a[:i] + a[i:j + 1][::-1] + a[j + 1:] == sorted_a:
		return 'yes\n{} {}'.format(i + 1, j + 1)
	return 'no'
n = int(stdin.readline().strip())
a = list(map(int, input().rstrip().split()))
stdout.write(str(solve(a, n)))


n = int(input())
s = list(map(int, input().split()))
a = list()
z = sorted(s)
q1 = q3 = -1
for i in range(n):
	if s[i] != z[i]:
		q1 = i
		break
if q1 == -1:
	print('yes')
	print('1', '1')
	exit()
for i in range(n - 1, q1, -1):
	if s[i] != z[i]:
		q3 = i
		break
a = list(reversed(s[q1:q3 + 1]))
d = z[q1:q3 + 1]
if a == d:
	print('yes')
	print(q1 + 1, q3 + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
l = 0
r = n - 1
a.append(0)
for i in range(n):
	if a[i] > a[i + 1]:
		l = i
		break
	else:
		l = i
for i in range(n - 1, 0, -1):
	if a[i] < a[i - 1]:
		r = i
		break
	else:
		r = i
for i in range((r - l) // 2 + 1):
	(a[l + i], a[r - i]) = (a[r - i], a[l + i])
kt = True
for i in range(n - 1):
	if a[i] > a[i + 1]:
		kt = False
if kt:
	print('yes')
else:
	print('no')
if kt:
	if l >= r:
		print(1, 1)
	else:
		print(l + 1, r + 1)


n = int(input())
arr = list(map(int, input().split()))
x = sorted(arr)
if arr == x:
	print('yes\n1 1')
	exit()
(l, r) = (-1, -1)
for i in range(n):
	if arr[i] != x[i]:
		if l == -1:
			l = i
		else:
			r = i
arr[l:r + 1] = arr[l:r + 1][::-1]
if arr == x:
	print('yes')
	print(l + 1, r + 1)
else:
	print('no')


n = int(input())
indices = set()
bl = False
massiv = list(map(int, input().split()))
for i in range(n - 1):
	if massiv[i] >= massiv[i + 1]:
		indices.add(i)
		indices.add(i + 1)
		bl = True
	elif bl:
		break
(ma, mi) = (0, 0)
if indices:
	(ma, mi) = (max(indices) + 1, min(indices))
	massiv[mi:ma] = sorted(massiv[mi:ma])
	mi += 1
if massiv == sorted(massiv):
	print('yes')
	if ma and mi:
		print(mi, ma)
	else:
		print(1, 1)
else:
	print('no')


def issorted(l):
	x = sorted(l)
	if x == l:
		return True
	else:
		return False
n = int(input())
x = input()
lis = [int(z) for z in x.split()]
f = 1
front = 0
for a in range(n - 1):
	if lis[a] > lis[a + 1]:
		front = a
		f = 0
		break
if f:
	print('yes')
	print('1 1')
else:
	end = front
	while end < n - 1 and lis[end] > lis[end + 1]:
		end += 1
	if issorted(reversed(lis)):
		print(reversed(lis))
	elif front == 0:
		ans = lis[0:front] + lis[end:None:-1] + lis[end + 1:n]
	elif end == n - 1:
		ans = lis[0:front] + lis[end:front - 1:-1]
	else:
		ans = lis[0:front] + lis[end:front - 1:-1] + lis[end + 1:n]
	if issorted(ans):
		print('yes')
		print('{} {}'.format(front + 1, end + 1))
	else:
		print('no')


from sys import stdin
n = int(input())
l = list(map(int, stdin.readline().rstrip().split(' ')))
if n == 1:
	print('yes')
	print(1, 1)
elif n == 2:
	print('yes')
	if l[0] > l[1]:
		print(1, 2)
	else:
		print(1, 1)
else:
	x = 1
	r = sorted(l)
	s = -1
	la = -1
	for i in range(1, n):
		if l[i] < l[i - 1]:
			if s == -1:
				s = i - 1
		if l[i] > l[i - 1] and s != -1:
			la = i
			break
	if s != -1:
		if la == -1:
			la = n
		l[s:la] = sorted(l[s:la])
	if l == r:
		if s == -1 and la == -1:
			print('yes')
			print(1, 1)
		else:
			print('yes')
			print(s + 1, la)
	else:
		print('no')


input()
temp1 = 0
temp3 = 0
li = list(map(int, input().split()))
li1 = sorted(li)
leng = len(li)
if sorted(li) == li[::-1]:
	print('yes')
	print(1, leng)
else:
	for i in range(leng - 1):
		if li[i] > li[i + 1]:
			temp1 = i
			break
	for i in range(temp1, leng - 1):
		if li[i] < li[i + 1]:
			temp2 = i
			break
		else:
			temp2 = leng - 1
	for i in range(temp2, leng - 1):
		if li[i] > li[i + 1]:
			temp3 = 1
			break
	li[temp1:temp2 + 1] = reversed(li[temp1:temp2 + 1])
	if li1 == li and temp3 == 0:
		print('yes')
		print(temp1 + 1, temp2 + 1)
	else:
		print('no')


import sys
INT_MAX = sys.maxsize
INT_MIN = -sys.maxsize - 1
sys.setrecursionlimit(10 ** 7)
mod = 1000000007

def IOE():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	x = sorted(a)
	y = a.copy()
	if x == a:
		print('yes')
		print(1, 1)
	else:
		(s, e) = (0, 0)
		for f in range(n):
			if x[f] != a[f]:
				s = f
				break
		for b in range(n - 1, -1, -1):
			if x[b] != a[b]:
				e = b
				break
		y[s:e + 1] = y[s:e + 1][::-1]
		if y == sorted(a):
			print('yes')
			print(s + 1, e + 1)
		else:
			print('no')
try:
	IOE()
except:
	pass
main()


n = int(input())
l = list(map(int, input().split()))
start = 0
end = 0
a = []
for i in range(len(l)):
	a.append(l[i])
a.sort()
c = 0
for i in range(len(l)):
	if l[i] != a[i]:
		start = i
		break
for i in range(len(l) - 1, -1, -1):
	if l[i] != a[i]:
		end = i
		break
l = l[start:end + 1]
f = 0
for i in range(1, len(l)):
	if l[i] > l[i - 1]:
		f = 1
if f == 0:
	print('yes')
	print(start + 1, end + 1)
else:
	print('no')


from math import factorial
n = int(input())
nums = [int(x) for x in input().split(' ')]
cnt_s = 0
(left, right, flag) = (-1, -1, False)
for i in range(1, n):
	if nums[i] < nums[i - 1]:
		if not flag:
			cnt_s += 1
			left = i - 1
		flag = True
	else:
		if flag:
			right = i - 1
		flag = False
if left != -1 and right == -1:
	right = n - 1
if cnt_s > 1:
	print('no')
elif cnt_s == 0:
	print('yes')
	print('1 1')
else:
	(copy_l, copy_r) = (left, right)
	while left <= right:
		tmp = nums[left]
		nums[left] = nums[right]
		nums[right] = tmp
		left += 1
		right -= 1
	sort_f = True
	for i in range(1, n):
		if nums[i] < nums[i - 1]:
			sort_f = False
			break
	if sort_f:
		print('yes')
		print(copy_l + 1, copy_r + 1)
	else:
		print('no')


num = int(input())
arr = []
arr = [int(n) for n in input().split()]

def isSorted(a):
	for x in range(0, len(a) - 1):
		if a[x] <= a[x + 1]:
			check = True
			continue
		else:
			check = False
			break
	return check
if num == 1 or isSorted(arr) == True:
	print('yes')
	print('1 1')
elif isSorted(arr) == False:
	i = 0
	while i != len(arr):
		if arr[i] < arr[i + 1]:
			i += 1
			continue
		else:
			l = i + 1
			break
	i = num - 1
	while i != -1:
		if arr[i] > arr[i - 1]:
			i -= 1
			continue
		else:
			r = i + 1
			break
	i = l - 1
	j = r - 1
	while i <= j:
		temp = arr[i]
		arr[i] = arr[j]
		arr[j] = temp
		i += 1
		j -= 1
	if isSorted(arr) == True:
		print('yes')
		print('{} {}'.format(l, r))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
l = 0
r = n - 1
while l < n and a[l] == sorted_a[l]:
	l += 1
while r > 0 and a[r] == sorted_a[r]:
	r -= 1
(i, j) = (l, r)
while i < j:
	(a[i], a[j]) = (a[j], a[i])
	i += 1
	j -= 1
if a != sorted_a:
	print('no')
	exit()
print('yes')
if l > r:
	l = r = 0
print(l + 1, r + 1)


while True:
	try:

		def solution(n, a):
			sgmnt = [0, 0]
			incrsng = True
			for i in range(1, n, 1):
				if a[i] < a[i - 1]:
					incrsng = False
					break
			if incrsng:
				print('yes')
				print(1, 1)
			else:
				decrsng = False
				cunt = 0
				for i in range(1, n, 1):
					if a[i] < a[i - 1] and (not decrsng):
						cunt += 1
						decrsng = True
						sgmnt[0] = i - 1
					elif a[i] > a[i - 1]:
						if decrsng:
							sgmnt[1] = i
						decrsng = False
				if sgmnt[1] == 0:
					sgmnt[1] = n
				a[sgmnt[0]:sgmnt[1]] = a[sgmnt[0]:sgmnt[1]][::-1]
				incrsng = True
				for i in range(1, n, 1):
					if a[i] < a[i - 1]:
						incrsng = False
						break
				if incrsng and cunt <= 1:
					print('yes')
					print(sgmnt[0] + 1, sgmnt[1])
				else:
					print('no')

		def read():
			n = int(input())
			a = list(map(int, input().split()))
			solution(n, a)
		if __name__ == '__main__':
			read()
	except EOFError:
		break


def is_sorted(array):
	return all((array[x] <= array[x + 1] for x in range(len(array) - 1)))
size_of_array = int(input())
arrays = list(map(int, input().split()))
left = size_of_array
right = 0
idx = 0
while idx < size_of_array - 1:
	if arrays[idx] > arrays[idx + 1]:
		left = min(left, idx)
		right = idx + 1
	idx += 1
if left == size_of_array and right == 0:
	print('yes')
	print(1, 1)
else:
	descending_array = arrays[left:right + 1]
	descending_array = list(reversed(descending_array))
	arrays = arrays[:left] + descending_array + arrays[right + 1:]
	if is_sorted(arrays):
		print('yes')
		print(left + 1, right + 1)
	else:
		print('no')


n = int(input())
a = [int(x) for x in input().split()]
fault = 0
currentMaxIncrease = 0
currentMinDecrease = 0
currentValue = 0
increase = True
check = False
for i in range(0, n):
	if fault <= 1:
		if increase:
			if a[i] < currentValue:
				fault += 1
				increase = not increase
				currentMinDecrease = i
			else:
				currentMaxIncrease = i
			currentValue = a[i]
		else:
			if a[i] > currentValue:
				increase = not increase
				fault += 1
			else:
				currentMinDecrease = i
			currentValue = a[i]
	elif increase:
		if a[i] < currentValue:
			fault += 1
			increase = not increase
		currentValue = a[i]
	else:
		if a[i] > currentValue:
			increase = not increase
			fault += 1
		currentValue = a[i]
if fault == 0:
	print('yes')
	print(1, 1)
elif fault <= 2:
	if currentMaxIncrease != 0:
		if a[currentMinDecrease] > a[currentMaxIncrease - 1]:
			check = True
	else:
		check = True
	if check:
		if currentMinDecrease != n - 1:
			if a[currentMaxIncrease] < a[currentMinDecrease + 1]:
				check = True
			else:
				check = False
	if check:
		print('yes')
		print(currentMaxIncrease + 1, currentMinDecrease + 1)
	else:
		print('no')
else:
	print('no')


def main():
	n = int(input())
	seq = list(map(int, input().split()))
	start = 0
	for i in range(1, n):
		if seq[i] < seq[i - 1]:
			start = i - 1
			break
	j = start + 1
	while j <= n:
		if j == n:
			if start > 0:
				if seq[start - 1] > seq[j - 1]:
					print('no')
					return 0
			print('yes')
			print(str(start + 1) + ' ' + str(n))
			return 0
		elif seq[j] > seq[j - 1]:
			if seq[j] < seq[start]:
				print('no')
				return 0
			else:
				for k in range(j, n):
					if seq[k] < seq[k - 1]:
						print('no')
						return 0
				if start > 0:
					if seq[start - 1] > seq[j - 1]:
						print('no')
						return 0
				print('yes')
				print(str(start + 1) + ' ' + str(j))
				return 0
		else:
			j += 1
	print('no')
	return 0
main()


n = int(input())
arr = list(map(int, input().split()))
newArr = arr.copy()
newArr.sort()
i = 0
j = n - 1
if arr == newArr:
	print('yes')
	print('1 1')
else:
	while arr[i] == newArr[i]:
		i += 1
	while arr[j] == newArr[j]:
		j -= 1
	if arr[i:j + 1] == newArr[i:j + 1][::-1]:
		print('yes')
		print(1 + min(i, j), 1 + max(i, j))
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
k = sorted(l)
t = []
for i in range(n):
	if l[i] != k[i]:
		t.append(i)
if len(t) == 0:
	print('yes')
	print(1, 1)
else:
	a = min(t)
	b = max(t)
	if l[:a] + l[a:b + 1][::-1] + l[b + 1:] == k:
		print('yes')
		print(a + 1, b + 1)
	else:
		print('no')


import math
from collections import Counter

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	if arr == sorted(arr):
		print('yes')
		print('1 1')
		return
	if arr[::-1] == sorted(arr):
		print('yes')
		print(1, n)
		return
	for i in range(n):
		if arr[i] > arr[i + 1]:
			start = i
			if arr[:i] + arr[i:][::-1] == sorted(arr):
				print('yes')
				print(start + 1, n)
				return
			for j in range(i + 1, n):
				if arr[j] > arr[start]:
					end = j
					break
			break
	if arr[:i] + arr[i:j][::-1] + arr[j:] == sorted(arr):
		print('yes')
		print(start + 1, end)
		return
	print('no')
main()


c = int(input())
l = list(map(int, input().split()))
a = l.copy()
l.sort()
w = [True if a[i] == l[i] else False for i in range(len(l))]
if w.count(True) == len(w):
	print('yes\n1 1')
else:
	start = w.index(False)
	w.reverse()
	stop = len(a) - w.index(False) - 1
	if start - 1 >= 0:
		a[start:stop + 1] = a[stop:start - 1:-1]
	else:
		a[start:stop + 1] = a[stop::-1]
	if l == a:
		print('yes')
		print(start + 1, stop + 1)
	else:
		print('no')


size = int(input())
array = list(map(int, input().split()))
check = sorted(array)
(head, k, flag, capt, didHappen) = (0, 1, 0, 0, 0)
while k < size:
	if array[head] > array[k] and (not flag):
		didHappen = 1
		flag = 1
		capt = head
	elif array[head] < array[k] and flag:
		break
	head += 1
	k += 1
if didHappen:
	middle = array[capt:k]
	end = array[k:]
	begin = array[:capt]
	middle.reverse()
	ch = begin + middle + end
	if ch == check:
		print('yes')
		print(capt + 1, k)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


def next(arr):
	sorted_arr = sorted(arr)
	diff = [sorted_arr[i] - arr[i] for i in range(len(arr))]
	i = 0
	fnz = 0
	lnz = len(arr) - 1
	while (diff[fnz] == 0 or diff[lnz] == 0) and i < len(arr) - 1:
		if diff[fnz] == 0:
			fnz += 1
		if diff[lnz] == 0:
			lnz -= 1
		i += 1
	if fnz == len(arr) - 1 and lnz == 0:
		print('yes')
		print(lnz + 1, lnz + 1)
	elif fnz == lnz:
		print('yes')
		print(lnz + 1, lnz + 1)
	else:
		rev = reversed(arr[fnz:lnz + 1])
		if tuple(rev) == tuple(sorted_arr[fnz:lnz + 1]):
			print('yes')
			print(fnz + 1, lnz + 1)
		else:
			print('no')
	return
n = input()
arr = list(map(int, input().split()))
next(arr)


arrayLength = int(input().split()[0])
array = list(map(int, input().split()))
arraySorted = sorted(array)
left = 0
for i in range(arrayLength):
	if array[i] != arraySorted[i]:
		left = i
		break
right = arrayLength - 1
for i in range(arrayLength):
	right = arrayLength - i - 1
	if array[arrayLength - i - 1] != arraySorted[arrayLength - i - 1]:
		break
canBeSorted = True
for i in range(left, right):
	if array[i] < array[i + 1]:
		canBeSorted = False
if canBeSorted:
	print('yes')
	print(str(left + 1) + ' ' + str(right + 1))
else:
	print('no')


n = int(input())
num = list(map(int, input().split()))
start = -100
end = 0
cont = False
done = False
ok = True
if num == sorted(num):
	print('yes')
	print(1, 1)
else:
	for i in range(n - 1):
		if num[i] > num[i + 1] and done == False and (cont == False):
			cont = True
			start = i
		elif num[i] < num[i + 1] and cont:
			end = i + 1
			done = True
			cont = False
		elif done and num[i] > num[i + 1]:
			ok = False
			break
	if start != -100 and end == 0:
		end = n
	nums = num[:start] + num[start:end][::-1] + num[end:]
	if nums != sorted(num):
		ok = False
	elif start == -100 and end == 0:
		start = 0
		end = 1
	if ok:
		print('yes')
		print(start + 1, end)
	else:
		print('no')


n = int(input())
l = [int(i) for i in input().split()]
s = sorted(l)
if s == l:
	print('yes')
	print(1, 1)
else:
	ans = []
	for i in range(len(l)):
		if l[i] == s[i]:
			continue
		else:
			ans.append(i)
	i = ans[0]
	j = ans[-1]
	p = l[i:j + 1]
	p = p[::-1]
	l = l[:i] + p + l[j + 1:]
	if l == s:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
i = 1
ans = 'yes'
(start, end) = (0, 1)
while i < n:
	if a[i - 1] > a[i]:
		start = i - 1
		while i < n and a[i - 1] > a[i]:
			i += 1
		end = i
		check = a[:start] + a[start:end][::-1] + a[end:]
		if check != sorted(check):
			ans = 'no'
			break
	else:
		i += 1
print(ans)
if ans == 'yes':
	print(start + 1, end)


n = int(input())
a = list(map(int, input().split()))
c = 1
f = 0
(l, r) = (0, 0)
for i in range(1, n):
	if a[i] <= a[i - 1]:
		if f == 0:
			f = 1
			l = i - 1
		r = i
if f == 0:
	print('yes')
	print(l + 1, r + 1)
else:
	for i in range(1, l):
		if a[i] >= a[i - 1]:
			c += 1
	if l > 0 and a[l - 1] <= a[r]:
		c += 1
	for i in range(l, r):
		if a[i] >= a[i + 1]:
			c += 1
	if r < n - 1 and a[l] <= a[r + 1]:
		c += 1
	for i in range(r + 2, n):
		if a[i] >= a[i - 1]:
			c += 1
	if c == n:
		print('yes')
		print(l + 1, r + 1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split()))
isIncreasing = True
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		isIncreasing = False
		break
if isIncreasing:
	print('yes')
	print('{0} {1}'.format(1, 1))
else:
	l = 0
	r = n - 1
	isFindL = False
	isFindR = False
	while l < r:
		if arr[l] < arr[l + 1] and isFindL is False:
			l += 1
		else:
			isFindL = True
		if arr[r] > arr[r - 1] and isFindR is False:
			r -= 1
		else:
			isFindR = True
		if isFindL is True and isFindR is True:
			break
	temp = arr[l:r + 1]
	for i in range(r, l - 1, -1):
		arr[i] = temp[r - i]
	isIncreasing = True
	for i in range(n - 1):
		if arr[i] > arr[i + 1]:
			isIncreasing = False
			break
	if isIncreasing:
		print('yes')
		print('{0} {1}'.format(l + 1, r + 1))
	else:
		print('no')


a = int(input())
b = [int(x) for x in input().split()]
index = 0
start = 0
end = 0
swiches = 0
while index < len(b) - 1 and swiches < 3:
	if b[index] > b[index + 1] and swiches % 2 == 0:
		swiches += 1
		start = index + 1
	if b[index] < b[index + 1] and swiches % 2 != 0:
		swiches += 1
		end = index + 1
	index += 1
if swiches == 0:
	print('yes')
	print(1, 1)
elif swiches == 1:
	if start != 1:
		if b[start - 2] > b[end - 1]:
			print('no')
		else:
			print('yes')
			print(start, len(b))
	else:
		print('yes')
		print(start, len(b))
elif swiches == 3:
	print('no')
elif not b[end - 1:] == sorted(b[end - 1:]):
	print('no')
elif start == 1:
	if b[end] < b[start - 1]:
		print('no')
	else:
		print('yes')
		print(start, end)
elif end == len(b):
	if b[start - 2] > b[end - 1]:
		print('no')
	else:
		print('yes')
		print(start, end)
elif b[start - 2] > b[end - 1] or b[end] < b[start - 1]:
	print('no')
else:
	print('yes')
	print(start, end)


p = int(input())
lst = list(map(int, input().split()))
lst1 = lst.copy()
lst1.sort()
if lst == lst1:
	print('yes')
	print('1 1')
else:
	i = 0
	q = -1
	q1 = 0
	while i < p:
		if q == -1:
			if lst[i] != lst1[i]:
				q = i
		elif lst[i] != lst1[i]:
			q1 = i
		i += 1
	lst2 = lst.copy()
	temp = lst2[q]
	lst2[q] = lst2[q + 1]
	lst2[q + 1] = temp
	if lst2 == lst1:
		print('yes')
		print(q + 1, q + 2)
	else:
		lst3 = lst[q:q1 + 1]
		lst3 = lst3[::-1]
		lst = lst[:q] + lst3 + lst[q1 + 1:]
		if lst == lst1:
			print('yes')
			print(q + 1, q1 + 1)
		else:
			print('no')


n = int(input())
a = list(map(int, input().split()))
(s, b, e) = ([], 0, 0)
for i in range(1, n):
	if a[i - 1] > a[i]:
		s.append(a[i - 1])
		e = i + 1
if a == sorted(a):
	print('yes')
	print(1, 1, sep=' ')
else:
	s.append(a[e - 1])
	b = e - len(s) + 1
	s.reverse()
	a = a[:b - 1] + s + a[e:]
	if a == sorted(a):
		print('yes')
		print(b, e, sep=' ')
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
sp = -1
ep = -1
ck = -1
for i in range(n - 1):
	if a[i] > a[i + 1]:
		if ck == 1:
			print('no')
			raise SystemExit
		if sp == -1:
			sp = i
		ep = i + 1
	elif sp != -1:
		ck = 1
if sp == -1 and ep == -1:
	print('yes')
	print(1, 1)
elif sp == 0 and ep == n - 1:
	print('yes')
	print(sp + 1, ep + 1)
elif sp != 0 and ep != n - 1:
	if a[sp] < a[ep + 1] and a[ep] > a[sp - 1]:
		print('yes')
		print(sp + 1, ep + 1)
	else:
		print('no')
elif sp != 0 and ep == n - 1:
	if a[ep] > a[sp - 1]:
		print('yes')
		print(sp + 1, ep + 1)
	else:
		print('no')
elif sp == 0 and ep != n - 1:
	if a[sp] < a[ep + 1]:
		print('yes')
		print(sp + 1, ep + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
l.insert(0, 0)
l.append(10 ** 9 + 1)
cont = 0
f = 1
res = []
for i in range(n + 1):
	if l[i] * f > l[i + 1] * f:
		f = f * -1
		cont += 1
		res.append(i)
		if cont > 2 or (cont == 2 and (l[res[0]] > l[i + 1] or l[i] < l[res[0] - 1])):
			print('no')
			exit(0)
print('yes')
if cont == 0:
	print('1 1')
elif cont == 2:
	print(' '.join(map(str, res)))


n = int(input())
inputArr = list(map(int, input().split()))
output = 'no'
i = 0
startIndex = 0
endIndex = 0
while i < n - 1:
	j = i
	while j < n - 1 and inputArr[j] > inputArr[j + 1] and (output == 'no'):
		flag = 0
		startIndex = i
		endIndex = j + 1
		j += 1
	if output == 'no' and startIndex != endIndex:
		if i == 0 and inputArr[j] > inputArr[i + 1] or (j < n - 1 and inputArr[i] > inputArr[j + 1]) or (i > 0 and inputArr[j] < inputArr[i - 1]):
			output = 'no'
			break
		else:
			output = 'yes'
			flag = 1
			i = j + 1
	elif output == 'yes' and startIndex != endIndex and (flag == 0):
		output = 'no'
		break
	elif output == 'yes' and startIndex != endIndex and (flag == 1) and (inputArr[j] > inputArr[j + 1]):
		output = 'no'
		break
	else:
		i += 1
if output == 'no' and startIndex == endIndex:
	output = 'yes'
if output == 'yes':
	print('yes')
	print(str(startIndex + 1) + ' ' + str(endIndex + 1))
else:
	print('no')


import operator
import os, sys
from collections import defaultdict, Counter, deque
from functools import lru_cache
from io import BytesIO, IOBase
from itertools import accumulate
from math import gcd, ceil, inf, sqrt, floor
import math

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	arr_sorted = sorted(arr)
	start = None
	end = None
	for i in range(0, n - 1):
		if arr[i] > arr[i + 1]:
			start = i
			end = i
			break
	if start == None:
		print('yes')
		print(1, 1)
		return
	while arr[end] > arr[end + 1]:
		end += 1
		if end == len(arr) - 1:
			break
	temparr = arr[start:end + 1]
	temparr.reverse()
	new_arr = arr[0:start] + temparr + arr[end + 1:len(arr)]
	if new_arr == arr_sorted:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
l = list(map(int, input().split()))
a = 0
b = 0
for i in range(n - 1):
	if l[i + 1] < l[i]:
		a = i
		break
for j in range(n - 1):
	if l[n - 1 - j] < l[n - 2 - j]:
		b = n - 1 - j
		break
li = l[a:b + 1]
c = 0
for i in range(len(li) - 1):
	if li[i] < li[i + 1]:
		c = 1
if a == 0 and b != n - 1:
	if li[0] > l[b + 1]:
		c = 1
if a != 0 and b == n - 1:
	if li[len(li) - 1] < l[a - 1]:
		c = 1
if a != 0 and b != n - 1:
	if li[0] > l[b + 1]:
		c = 1
	if li[len(li) - 1] < l[a - 1]:
		c = 1
if c == 1:
	print('no')
else:
	print('yes')
	lst = [str(a + 1), str(b + 1)]
	print(' '.join(lst))


m = int(input())
s = list(map(int, input().split()))
q = sorted(s)
r = 0
t = m - 1
if s == q:
	print('yes')
	print(1, 1)
else:
	while s[r] == q[r]:
		r += 1
	while s[t] == q[t]:
		t -= 1
	if s[r:t + 1] == q[r:t + 1][::-1]:
		print('yes')
		print(r + 1, t + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i = 0
while i < n and a[i] == b[i]:
	i += 1
j = n - 1
while j > -1 and a[j] == b[j]:
	j -= 1
if i > j:
	print('yes')
	print(1, 1)
else:
	c = a[:i] + a[i:j + 1][::-1] + a[j + 1:]
	if c == b:
		print('yes')
		print(i + 1, j + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
x = sorted(l)
if l == x:
	print('yes')
	print(1, 1)
	exit()
s = -1
e = n - 1
for i in range(n - 1):
	if l[i] > l[i + 1]:
		s = i
		break
for j in range(n - 1, 0, -1):
	if l[j] < l[j - 1]:
		e = j
		break
l1 = l[:s] + list(reversed(l[s:e + 1])) + l[e + 1:]
if l1 == x:
	print('yes')
	print(s + 1, e + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
start2 = False
start3 = False
start = 0
end = 1
for i in range(n - 1):
	if a[i + 1] < a[i] and (not start2):
		if start3:
			print('no')
			exit()
		start = i
		start2 = True
	elif start2:
		if a[i + 1] > a[i]:
			end = i + 1
			a = a[:start] + list(reversed(a[start:end])) + a[end:]
			start2 = False
			start3 = True
if start2:
	end = len(a)
if start2 and end == len(a):
	a = a[:start] + list(reversed(a[start:end])) + a[end:]
if a == sorted(a):
	print('yes')
	print(start + 1, end)
else:
	print('no')


inp = lambda : map(int, input().split(' '))
n = int(input())
a = list(inp())
i = 1
j = 0
if len(a) == 1:
	print('yes')
	print('1', '1')
else:
	for i in range(1, len(a)):
		k = 0
		if a[i - 1] >= a[i]:
			j = i - 1
			k = i
			while 1:
				k += 1
				if k > len(a) - 1 or a[k - 1] < a[k]:
					break
			k -= 1
			break
	i1 = k + 1
	i2 = j + 1
	while j <= k:
		(a[j], a[k]) = (a[k], a[j])
		j += 1
		k -= 1
	if all((a[i - 1] <= a[i] for i in range(1, len(a)))):
		print('yes')
		print(i2, i1)
	else:
		print('no')


n = int(input())
arr = list(map(int, input().split(' ')))
dp = -1
ip = -1
loop_count = 0
b = sorted(arr)
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		dp = i
		break
loop_count = dp
for i in range(dp, n - 1):
	if arr[i] < arr[i + 1]:
		ip = i + 1
		break
	loop_count += 1
if loop_count == n - 1:
	ip = loop_count + 1
if dp == -1:
	print('yes', end='\n')
	print('1 1')
else:
	arr[dp:ip] = reversed(arr[dp:ip])
	if b == arr:
		print('yes', end='\n')
		print(dp + 1, ip)
	else:
		print('no')


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
import heapq
x = int(stdin.readline())
mylist = list(map(int, stdin.readline().strip().split()))
out = [w for w in mylist]
out.sort()
a = b = 1
counter = 0
flag = False
for i in range(0, x):
	if mylist[i] != out[i]:
		if flag == False:
			a = i + 1
			flag = True
		else:
			b = i + 1
		counter += 1
if counter == 0:
	print('yes')
	print(1, 1)
else:
	for i in range(a, b):
		if mylist[i - 1] < mylist[i]:
			print('no')
			break
	else:
		print('yes')
		print(a, b)


n = int(input())
a = list(map(int, input().split()))
l = 0
h = 0
i = 1
while i < n:
	if a[i - 1] > a[i]:
		l = i - 1
		while a[i - 1] > a[i]:
			if i < n - 1:
				i = i + 1
			else:
				i = n
				break
		h = i - 1
	else:
		i = i + 1
x = sorted(a)
a[l:h + 1] = sorted(a[l:h + 1])
if x == a:
	print('yes')
	print(l + 1, h + 1)
else:
	print('no')


input()
arr = [int(i) for i in input().split()]
s = sorted(arr)
start = end = 0
for (n, (a, b)) in enumerate(zip(arr, s), 1):
	if a != b:
		if not start:
			start = n
		end = n
if not start:
	start = end = 1
arr[start - 1:end] = reversed(arr[start - 1:end])
if arr == s:
	print('yes')
	print(start, end)
else:
	print('no')


input()
li = [int(x) for x in input().split()]
past = 0
while past < len(li) - 1 and li[past] < li[past + 1]:
	past += 1
final = past
while final < len(li) - 1 and li[final] > li[final + 1]:
	final += 1
new_li = li[:past] + list(reversed(li[past:final + 1])) + li[final + 1:]

def test_sorted(li):
	for (i, num) in enumerate(li[:-1]):
		if num > li[i + 1]:
			return False
	return True
if test_sorted(li):
	print('yes')
	print(1, 1)
elif test_sorted(new_li):
	print('yes')
	print(past + 1, final + 1)
else:
	print('no')


size = int(input())
a = [int(k) for k in input().split()]
l = 0
for i in range(size - 2):
	if a[i + 1] < a[i]:
		l = i
		break
r = size - 1
for i in range(size - 1, -1, -1):
	if a[i - 1] > a[i]:
		r = i
		break
a[l:r + 1] = reversed(a[l:r + 1])
a = a[0:l] + a[l:r + 1] + a[r + 1:]
yes = True
for i in range(size - 1):
	if a[i + 1] < a[i]:
		yes = False
if yes:
	print('yes')
	print(str(l + 1) + ' ' + str(r + 1))
else:
	print('no')


a = int(input())
b = list(map(int, input().split()))
c = sorted(b)
if b == c:
	print('yes')
	print('{} {}'.format(1, 1))
	exit()
d = -1
e = -1
for i in range(a):
	if b[i] != c[i]:
		if d == -1:
			d = i
		else:
			e = i
b[d:e + 1] = b[d:e + 1][::-1]
if b == c:
	print('yes')
	print('{} {}'.format(d + 1, e + 1))
else:
	print('no')


import sys
n = int(input())
arr = [int(x) for x in input().split()]
s = sorted(arr)
if arr == s:
	print('yes')
	print('1 1')
	sys.exit()
seg_st = -1
seg_en = -1
for i in range(n):
	if seg_st == -1 and arr[i] != s[i]:
		seg_st = i
	if seg_st != -1 and seg_en == -1 and (arr[i] == s[i]):
		seg_en = i
	if seg_en != -1 and arr[i] != s[i]:
		seg_en = -1
if seg_en == -1:
	seg_en = n
ch = arr[seg_st:seg_en]
if s[seg_st:seg_en] == ch[::-1]:
	print('yes')
	print(seg_st + 1, seg_en)
else:
	print('no')


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial

def binNumber(n, size=1):
	return bin(n)[2:].zfill(size)

def iar():
	return list(map(int, input().split()))

def ini():
	return int(input())

def isp():
	return map(int, input().split())

def sti():
	return str(input())
n = ini()
a = iar()
b = a[0:n]
b.sort()
(c1, c2) = (-1, n - 1)
for i in range(n):
	if b[i] != a[i] and c1 == -1:
		c1 = i
	if b[i] == a[i] and c1 != -1 and (c2 == n - 1):
		if i < n - 1:
			if b[i + 1] == a[i + 1]:
				c2 = i - 1
		else:
			c2 = n - 2
if c1 == -1:
	print('yes\n1 1')
	quit()
i = c1
while i <= c2:
	if b[c2 - i + c1] != a[i]:
		print('no')
		quit()
	i += 1
print('yes')
print(c1 + 1, c2 + 1)


n = int(input())
l = list(map(int, input().split()))
l1 = sorted(l)
i = 0
j = len(l) - 1
si = 0
ei = 0
while i < len(l) - 1:
	if l1[i] != l[i]:
		si = i
		break
	i = i + 1
while j >= si and j >= 0:
	if l1[j] != l[j]:
		ei = j
		break
	j = j - 1
l2 = l[si:ei + 1]
l2.reverse()
l3 = []
k = 0
for i in range(len(l)):
	if i >= si and i <= ei:
		l3.append(l2[k])
		k += 1
	else:
		l3.append(l[i])
if l3 == l1:
	print('yes')
	print(si + 1, ei + 1, sep=' ')
else:
	print('no')


n = int(input())
(*a,) = map(int, input().split())
b = sorted(a)
mp = dict()
for i in range(n):
	mp[b[i]] = i
for i in range(n):
	a[i] = mp[a[i]]
L = -1
for i in range(n):
	if a[i] != i:
		L = i
		break
R = -1
for i in range(n - 1, -1, -1):
	if a[i] != i:
		R = i
		break
if L == -1 and R == -1:
	print('yes')
	print('1 1')
else:
	rev = a[L:R + 1]
	rev = rev[::-1]
	a = a[:L] + rev + a[R + 1:]
	ok = True
	for i in range(n):
		if a[i] != i:
			ok = False
	if ok:
		print('yes')
		print(L + 1, R + 1)
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
asort = sorted(a)
l = 1000000
r = 0
if n == 1:
	print('yes')
	print('1 1')
else:
	for i in range(n):
		if a[i] != asort[i]:
			if i < l:
				l = i
			if i > r:
				r = i
	na = a[l:r + 1]
	if l < r:
		nasort = asort[l:r + 1]
		for i in range(r - l + 1):
			if na[i] != nasort[r - l - i]:
				print('no')
				exit()
		print('yes')
		print(l + 1, r + 1)
	else:
		print('yes')
		print('1 1')


N = int(input())
a = list(map(int, input().split()))
pos_L = -1
for i in range(1, len(a)):
	if a[i] < a[i - 1]:
		pos_L = i - 1
		break
if pos_L == -1:
	print('yes')
	print('1 1')
	exit()
pos_R = -1
for i in range(len(a) - 1, 0, -1):
	if a[i] < a[i - 1]:
		pos_R = i
		break
if pos_R == -1:
	print('yes')
	print(1, N)
	exit()
half_len = (pos_R - pos_L + 1) // 2
for i in range(pos_L, pos_L + half_len):
	(a[i], a[pos_R + pos_L - i]) = (a[pos_R + pos_L - i], a[i])
for i in range(1, len(a)):
	if a[i] < a[i - 1]:
		print('no')
		exit()
print('yes')
print(pos_L + 1, pos_R + 1)


n = int(input())
l = list(map(int, input().split()))
copy = sorted(l)

def solve():
	i = 0
	flag = True
	(left, right) = (0, 0)
	while i < n:
		if l[i] != copy[i]:
			if flag:
				flag = False
				left = i
				while i + 1 < n and l[i + 1] < l[i]:
					i += 1
				right = i
			else:
				return (False, -1, -1)
		i += 1
	return (True, left + 1, right + 1)
(result, start, end) = solve()
if result:
	print('yes\n{} {}'.format(start, end))
else:
	print('no')


n = int(input())
seq = list(map(int, input().split()))
changes = 0
left = 0
down = 0
amount = 1
for i in range(n - 1):
	if seq[i] > seq[i + 1]:
		if changes == 0:
			left = i
		if down == 0:
			changes += 1
			down = 1
		else:
			amount += 1
	else:
		down = 0
if changes == 0:
	print('yes')
	print('1 1')
elif changes > 1:
	print('no')
else:
	right = left + amount
	if left > 0 and right < n - 1:
		if seq[right] > seq[left - 1] and seq[left] < seq[right + 1]:
			print('yes')
			print(left + 1, right + 1)
		else:
			print('no')
	elif left == 0 and right == n - 1:
		print('yes')
		print(1, n)
	elif left == 0:
		if seq[left] < seq[right + 1]:
			print('yes')
			print(1, right + 1)
		else:
			print('no')
	elif seq[right] > seq[left - 1]:
		print('yes')
		print(left + 1, n)
	else:
		print('no')


n = int(input())
l = [int(x) for x in input().split()]
l1 = sorted(l)
(a, b) = (0, len(l) - 1)
while l[a] == l1[a] and a < len(l) - 1:
	a += 1
if a == len(l) - 1 and l[a] == l1[a]:
	print('yes')
	print(1, 1)
	exit(0)
while l[b] == l1[b]:
	b -= 1
if l[a:b + 1] == l1[a:b + 1][::-1]:
	print('yes')
	print(a + 1, b + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split(' ')))
b = sorted(a)
Left = -1
Right = -1
for i in range(n):
	if a[i] != b[i] and Left == -1:
		Left = i
	if a[i] != b[i]:
		Right = i
if Left == -1 and Right == -1:
	Left = 0
	Right = 0
L = Left
R = Right
while L < R:
	(a[L], a[R]) = (a[R], a[L])
	L += 1
	R -= 1
for i in range(n):
	if a[i] != b[i]:
		print('no')
		exit()
print('yes')
print(str(Left + 1) + ' ' + str(Right + 1))


def reverse(a):
	return a[::-1]
n = int(input())
a = [int(i) for i in input().split()]
b = sorted(a)
if a == b:
	print('yes')
	print(1, 1)
	exit(0)
for i in range(n):
	if a[i] != b[i]:
		x = a.index(b[i])
		y = i
		break
if b == a[:y] + reverse(a[y:x + 1]) + a[x + 1:]:
	print('yes')
	print(y + 1, x + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = []
k = 0
if n == 1:
	print('yes')
	print('1 1')
else:
	for i in range(0, n - 1):
		b.append(a[i])
		if a[i] > a[i + 1] and k == 0:
			s = i
			e = i + 1
			k = k + 1
		elif a[i] > a[i + 1]:
			e = i + 1
	b.append(a[i + 1])
	b.sort()
	if (a != b) == True:
		for j in range(0, (e - s + 1) // 2):
			temp = a[s + j]
			a[s + j] = a[e - j]
			a[e - j] = temp
		if (a != b) == True:
			print('no')
		else:
			print('yes')
			print(s + 1, e + 1)
	else:
		print('yes')
		print('1 1')


n = int(input())
a = list(map(int, input().split()))
s = a.copy()
s.sort()
if a == s:
	print('yes\n1 1')
else:
	_First = -1
	_Last = -1
	for (i, x) in enumerate(a):
		if s[i] != x:
			if _First == -1:
				_First = i
			_Last = i
	__First = _First
	__Last = _Last
	_b = True
	while __First <= _Last and __Last >= _First:
		if a[__First] == s[__Last]:
			pass
		else:
			_b = False
		__First += 1
		__Last -= 1
	if _b:
		print('yes')
		print(str(_First + 1), str(_Last + 1))
	else:
		print('no')


n = int(input())
a = list(map(int, input().split()))
b = []
b.extend(a)
b.sort()
first = -1
last = -1
for i in range(0, n):
	if a[i] != b[i]:
		first = i
		break
i = n - 1
while i >= 0:
	if a[i] != b[i]:
		last = i
		break
	i = i - 1
if first != -1:
	ans = 1
	j = last
	for i in range(first, last + 1):
		if a[i] != b[j]:
			ans = 0
			break
		j = j - 1
	if ans == 1:
		print('yes')
		print(first + 1, last + 1)
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split()))
	x = 0
	y = 0
	flag = 1
	temp = a[0]
	ans = 'yes'
	m = 0
	for i in range(1, n):
		z = a[i]
		if z > temp and flag == 2 and (z > m):
			y = i
			temp = z
			flag = 3
		elif z > temp and z > m:
			temp = z
		elif z < temp and flag == 1:
			x = i
			flag = 2
			m = temp
			temp = z
		elif z < temp and flag == 2:
			temp = z
		else:
			ans = 'no'
			break
	if x != 0 and y == 0:
		y = n
	elif x == 0 and y == 0:
		x = 1
		y = 1
	if ans == 'yes':
		if a[y - 1] > a[x - 2] or x == 1:
			print(ans)
			print(x, y)
		else:
			print('no')
	else:
		print('no')

def nouse0():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse1():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse2():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def nouse3():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse4():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')

def nouse5():
	a = 420
	b = 420
	print(f'i am nitish{(a + b) // 2}')
main()


import sys
n = int(input())
x = [int(x) for x in input().split()]
l = sorted(x)
q = []
b = 'dummy'
a = 'dum'
for i in range(n - 1):
	if x[i] > x[i + 1]:
		a = i
		break
if a == 'dum':
	print('yes')
	print('1 1')
	sys.exit(0)
if a != n:
	for j in range(a, n - 1):
		if x[j] < x[j + 1]:
			b = j + 1
			break
if b == 'dummy':
	b = n
m = x[a:b]
x[a:b] = m[::-1]
if x == l:
	print('yes')
	print(a + 1, b)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = a[:]
b.sort()
for i in range(n):
	if a[i] != b[i]:
		break
if i == n - 1:
	print('yes')
	print('1 1')
	exit(0)
ans = i
for i in range(n - 1, -1, -1):
	if a[i] != b[i]:
		break
end = i + 1
ans1 = a[:ans] + a[ans:end][::-1] + a[end:]
if ans1 == b:
	print('yes')
	print(ans + 1, end)
else:
	print('no')


def SortTheArray(n, arr):
	i = 0
	l = -1
	r = -1
	flag = 'no'
	while i <= n - 2:
		if arr[i] > arr[i + 1]:
			l = i + 1
			break
		i += 1
	i = n - 1
	while i >= 1:
		if arr[i] < arr[i - 1]:
			r = i + 1
			break
		i -= 1
	if l == -1 and r == -1:
		return ('yes', 1, 1)
	if l - 1 >= 0 and r < n and (arr[l - 1] > arr[r]) or (l - 2 >= 0 and arr[r - 1] < arr[l - 2]):
		return (flag, -1, -1)
	i = l - 1
	while i < r - 2:
		if arr[i] < arr[i + 1]:
			return (flag, -1, -1)
		i += 1
	flag = 'yes'
	return (flag, l, r)
n = int(input())
arr = [int(x) for x in input().split()]
(result, l, r) = SortTheArray(n, arr)
print(result)
if result == 'yes':
	print(str(l) + ' ' + str(r))


n = int(input())
arr = list(map(int, input().split()))
srtedarr = list(sorted(arr))
if list(reversed(arr)) == srtedarr:
	print('yes')
	print(1, n)
elif arr == srtedarr:
	print('yes')
	print(1, 1)
else:
	c = 0
	(l, r) = (-1, -1)
	for i in range(0, n):
		if arr[i] != srtedarr[i]:
			c += 1
			r = i + 1
			if l == -1:
				l = i + 1
	else:
		arr[l - 1:r] = list(reversed(arr[l - 1:r]))
		if arr == srtedarr:
			print('yes')
			print(l, r)
		else:
			print('no')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def bs(a, l, h, x):
	while l < h:
		mid = (l + h) // 2
		if a[mid] == x:
			return mid
		if a[mid] < x:
			l = mid + 1
		else:
			h = mid
	return l

def sieve(a):
	for i in range(3, 10 ** 6 + 1, 2):
		a[i] = 1
	for i in range(3, 10 ** 6 + 1, 2):
		for j in range(i * i, 10 ** 6 + 1, i):
			a[j] = 0
	a[2] = 1
	return a

def solve():
	n = int(inp())
	a = lis()
	ind = []
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i] or (a[i - 1] > a[i] and a[i + 1] > a[i]):
			ind.append(i)
	if len(ind) > 2:
		print('no')
		return
	if len(ind) == 0:
		if a == sorted(a):
			print('yes')
			print(1, 1)
			return
		else:
			print('yes')
			print(1, n)
			return
	if len(ind) == 1:
		i = ind[0]
		temp = a[:i + 1]
		if temp[::-1] + a[i + 1:] == sorted(a):
			print('yes')
			print(1, i + 1)
			return
		temp = a[i:]
		if a[:i] + temp[::-1] == sorted(a):
			print('yes')
			print(i + 1, n)
			return
		print('no')
	else:
		i = ind[0]
		j = ind[1]
		tem = a[i:j + 1]
		temp = a[:i] + tem[::-1] + a[j + 1:]
		if temp == sorted(a):
			print('yes')
			print(i + 1, j + 1)
			return
		print('no')
testcase(1)


n = int(input())
l = [int(x) for x in input().split(' ')]
start = 1
end = 1
i = 0
found_flip = False
while i < n:
	if i < n - 1 and l[i] > l[i + 1]:
		if found_flip:
			print('no')
			exit()
		found_flip = True
		start = i + 1
		prev = 0
		first = l[i]
		if i > 0:
			prev = l[i - 1]
		while i < n - 1 and l[i] > l[i + 1]:
			if l[i + 1] < prev:
				print('no')
				exit()
			i += 1
		if i < n - 1 and l[i + 1] < first:
			print('no')
			exit()
		end = i + 1
	i += 1
print('yes')
print(' '.join((str(x) for x in [start, end])))


n = int(input())
list1 = [int(i) for i in input().split()]
list2 = sorted(list1)
if list1 == list2:
	print('yes')
	print(1, 1)
else:
	prev = list1[0]
	l = -1
	r = -1
	for x in range(1, len(list1)):
		if list1[x] < prev:
			l = x
			break
		prev = list1[x]
	prev = list1[-1]
	for y in range(len(list1) - 2, -1, -1):
		if list1[y] > prev:
			r = y + 2
			break
		prev = list1[y]
	if l == -1 and r == -1:
		print('no')
	else:
		val = list1[l - 1:r]
		val.reverse()
		new = list1[:l - 1] + val + list1[r:]
		if new == list2:
			print('yes')
			print(l, r)
		else:
			print('no')


t = int(input())
arr = [int(x) for x in input().split()]
start = 0
end = 0
flag = False
for i in range(t - 1):
	if arr[i] > arr[i + 1] and start > 0:
		if not flag:
			end = -1
			break
		end += 1
	elif arr[i] > arr[i + 1]:
		flag = True
		start = i + 1
		end = i + 2
	else:
		flag = False
tmp = arr
if start != end:
	tmp = arr[start - 1:end][::-1]
sorteed = True
for i in range(end - start):
	if tmp[i] > tmp[i + 1]:
		sorteed = False
		break
if end < 0:
	print('no')
elif end < t and tmp[end - start] > arr[end]:
	print('no')
elif start > 1 and tmp[0] < arr[start - 2]:
	print('no')
elif start == 0 and end == 0:
	print('yes')
	print(start + 1, end + 1)
elif start <= end and sorteed:
	print('yes')
	print(start, end)
else:
	print('no')


count = int(input())
my_list = [int(x) for x in input().split()]
i = 1
while i < count:
	if my_list[i] < my_list[i - 1]:
		i -= 1
		break
	i += 1
j = i + 1
while j < count:
	if my_list[j] > my_list[j - 1]:
		break
	j += 1
sort_list = my_list[:i] + my_list[i:j][::-1] + my_list[j:]
my_list.sort()
if i >= count:
	print('yes')
	print(1, 1)
elif my_list == sort_list:
	print('yes')
	print(i + 1, j)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b.sort()
if a == b:
	print('yes')
	print('1 1')
else:
	(l, r, seg) = (1, 2, 0)
	(res1, res2) = (1, 1)
	while l <= n:
		while r <= n and a[r - 1] < a[r - 2]:
			r += 1
		if r <= n:
			if a[l - 1] > a[r - 1]:
				seg = -1000000000
		if l >= 2:
			if a[r - 2] < a[l - 2]:
				seg = -1000000000
		if l + 1 < r:
			seg += 1
			(res1, res2) = (l, r - 1)
		l = r
		r += 1
	if seg < 0 or seg >= 2:
		print('no')
	else:
		print('yes')
		print(res1, end=' ')
		print(res2)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
n = L()[0]
A = L()
B = sorted(A)
ans = [0 for i in range(n)]
for i in range(n):
	if A[i] != B[i]:
		ans[i] = 1
if 1 not in ans:
	print('yes')
	print(1, 1)
	exit()
x = ans.index(1)
y = n - ans[::-1].index(1)
A[x:y] = A[x:y][::-1]
if A == B:
	print('yes')
	print(x + 1, y)
else:
	print('no')
endtime = time.time()


n = int(input())
l = [int(item) for item in input().split()]

def sort_the_array(a):
	found = False
	already_found_reverse = False
	idx_beg = 0
	idx_end = 0
	for i in range(0, len(a) - 1):
		if already_found_reverse and a[i] > a[i + 1]:
			print('no')
			return
		elif not found and a[i] > a[i + 1]:
			found = True
			idx_beg = i
		elif not already_found_reverse and found and (a[i] < a[i + 1]):
			already_found_reverse = True
			idx_end = i
	if found and (not already_found_reverse):
		idx_end = n - 1
	if idx_beg > 0 and a[idx_beg - 1] > a[idx_end] or (idx_end < n - 1 and a[idx_end + 1] < a[idx_beg]):
		print('no')
		return
	print('yes')
	print(str(idx_beg + 1) + ' ' + str(idx_end + 1))
sort_the_array(l)


sign = 1
n = int(input())
a = (lambda : list(map(int, input().split())))()
i = 0
count = 0
indexes = []
while i < n - 1:
	if (a[i + 1] - a[i]) * sign < 0:
		count += 1
		sign *= -1
		indexes.append(i)
	i += 1
if count == 0:
	print('yes')
	print(1, 1)
elif count == 1:
	if indexes[0] == 0:
		print('yes')
		print(1, n)
	elif a[indexes[0] - 1] <= a[n - 1]:
		print('yes')
		print(indexes[0] + 1, n)
	else:
		print('no')
elif count == 2:
	if (indexes[1] == n - 1 or a[indexes[0]] <= a[indexes[1] + 1]) and (indexes[0] == 0 or a[indexes[1]] >= a[indexes[0] - 1]):
		print('yes')
		print(indexes[0] + 1, indexes[1] + 1)
	else:
		print('no')
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
l = 0
while l < n - 1 and a[l] <= a[l + 1]:
	l += 1
r = n - 1
while r > 0 and a[r - 1] <= a[r]:
	r -= 1
if l < r:
	good = True
	for i in range(r, l, -1):
		if a[i] > a[i - 1]:
			good = False
	if good:
		left = False
		right = False
		if l == 0:
			right = True
		elif a[l - 1] <= a[r]:
			right = True
		if r == n - 1:
			left = True
		elif a[r + 1] >= a[l]:
			left = True
		if left and right:
			print('yes')
			print(l + 1, r + 1)
		else:
			print('no')
	else:
		print('no')
else:
	print('yes')
	print(1, 1)


def isinc(a):
	for i in range(len(a) - 1):
		if a[i] > a[i + 1]:
			return False
	return True
n = int(input())
a = list(map(int, input().split()))
b = a[:]
b.sort()
i = 0
for x in range(n):
	if a[x] != b[x]:
		i = x
		break
idx1 = i
while True:
	if i >= n - 1:
		break
	if a[i] <= a[i + 1]:
		break
	i += 1
a[idx1:i + 1] = reversed(a[idx1:i + 1])
if isinc(a):
	print('yes')
	print(idx1 + 1, i + 1)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b.sort()
l = 1
r = 1
f = 0
c = []
for i in range(n):
	if a[i] != b[i]:
		c.append(i + 1)
c.sort()
d = len(c)
if d > 0:
	l = c[0]
	r = c[d - 1]
e = list(reversed(a[l - 1:r]))
if e == b[l - 1:r]:
	print('yes')
	print(l, r)
else:
	print('no')


n = int(input())
array = list(map(int, input().rstrip().split()))
array1 = sorted(array.copy())
if array == array1:
	print('yes')
	print('1 1')
	exit()
for a in range(n):
	if array[a] != array1[a]:
		while n > a:
			if array[n - 1] == array1[n - 1]:
				n -= 1
			else:
				break
		break
if list(reversed(array1[a:n])) == array[a:n]:
	print('yes')
	print(a + 1, n)
else:
	print('no')


from sys import stdin, stdout
import math
import bisect
input = stdin.readline

def print(x='', y='', end='\n'):
	if y == '':
		stdout.write(str(x) + end)
	else:
		stdout.write(str(x) + ' ' + str(y) + end)

def solve():
	n = int(input())
	l = list(map(int, input().split()))
	(st, end) = (-1, -1)
	for i in range(n - 1):
		if l[i + 1] < l[i]:
			st = i
			break
	for i in range(n - 1, 0, -1):
		if l[i - 1] > l[i]:
			end = i
			break
	if st == -1 and end == -1:
		print('yes')
		print(1, 1)
		return
	l[st:end + 1] = l[st:end + 1][-1::-1]
	for i in range(n - 1):
		if l[i + 1] < l[i]:
			print('no')
			return
	print('yes')
	print(st + 1, end + 1)
tt = 1
for __ in range(tt):
	solve()


n = int(input())
l = [int(x) for x in input().split()]
start = 0
end = 0
sibling = -1
des_order = False
for i in range(len(l)):
	if i != len(l) - 1:
		if l[i] > l[i + 1] and (not des_order):
			des_order = True
			if sibling != -1:
				start = sibling
			else:
				start = i
		if l[i] < l[i + 1]:
			if des_order:
				end = i
				break
			else:
				sibling = -1
		if l[i] == l[i + 1]:
			sibling = i
	elif des_order:
		end = i
a = False
if end < len(l) - 1:
	for j in range(end, len(l) - 1):
		if l[j] > l[j + 1]:
			print('no')
			a = True
			break
if not a:
	if not des_order or ((end == len(l) - 1 or l[start] <= l[end + 1]) and (start == 0 or l[end] >= l[start - 1])):
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


n = int(input())
arr = [int(i) for i in input().split()]
start = 0
end = 0
found = False
done = False
for i in range(n - 1):
	if arr[i] > arr[i + 1]:
		if found and end:
			done = True
			break
		elif not found:
			found = True
			start = i
	elif not end and found:
		end = i
if not end and found:
	end = n - 1
if done:
	print('no')
else:
	if start > 0 and arr[start - 1] > arr[end]:
		done = True
	elif end < n - 1 and arr[end + 1] < arr[start]:
		done = True
	if not done:
		print('yes')
		end_ = end
		print(start + 1, end_ + 1)
	else:
		print('no')


import math
n = int(input())
l = list(map(int, input().split()))
c = 0
p = 0
mi = math.inf
m = -1
for i in range(len(l) - 1):
	if l[i] >= l[i + 1] and p == 0:
		p = 1
		c += 1
		mi = min(i, mi)
	if l[i] >= l[i + 1]:
		m = i
	else:
		p = 0
if m + 2 < len(l) and c <= 1 and (mi != math.inf) and (l[m + 2] >= l[mi]) or (len(l) <= 2 and mi != math.inf) or (m + 2 == len(l) and c == 1):
	if mi > 0 and l[mi - 1] < l[m + 1] or mi == 0:
		print('yes')
		print(mi + 1, m + 2)
	else:
		print('no')
elif m == -1 and mi == math.inf:
	print('yes')
	print(1, 1)
else:
	print('no')


n = int(input())
lis = input().split()
for i in range(n):
	lis[i] = int(lis[i])
lis1 = sorted(lis)
lis2 = []
if lis == lis1:
	print('yes')
	print(1, 1)
else:
	for i in range(n):
		if lis1[i] != lis[i]:
			lis2.append(i)
	if lis[lis2[0]:lis2[len(lis2) - 1] + 1][::-1] == sorted(lis[lis2[0]:lis2[len(lis2) - 1] + 1]):
		print('yes')
		print(lis2[0] + 1, lis2[len(lis2) - 1] + 1)
	else:
		print('no')


n = int(input())
l = list(map(int, input().split()))
(start, end) = (-1, n - 1)
for i in range(n - 1):
	if l[i] > l[i + 1]:
		start = i
		j = i + 1
		while j < n:
			if l[j] > l[j - 1]:
				end = j - 1
				break
			j += 1
		break
if start == -1:
	print('yes')
	print(1, 1)
else:
	l = l[:start] + l[start:end + 1][::-1] + l[end + 1:]
	flag = 1
	for i in range(n - 1):
		if l[i] > l[i + 1]:
			flag = 0
			break
	if flag:
		print('yes')
		print(start + 1, end + 1)
	else:
		print('no')


n = int(input(''))
lst = list(map(int, input('').split()))
sorted_lst = sorted(lst)
l = 0
r = len(lst) - 1
for i in range(0, len(lst)):
	if lst[i] == sorted_lst[i]:
		if i == len(lst) - 1:
			l = i
		continue
	else:
		l = i
		break
for j in range(len(lst) - 1, -1, -1):
	if lst[j] == sorted_lst[j]:
		if j == 0:
			r = j
		continue
	else:
		r = j
		break
first = l + 1
second = r + 1
while l < r:
	if lst[l] == sorted_lst[r] and lst[r] == sorted_lst[l]:
		l += 1
		r -= 1
	else:
		break
if l >= r:
	if first == len(lst) and second == 1:
		print('yes')
		print(1, 1)
	else:
		print('yes')
		print(first, second)
else:
	print('no')


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
x = 0
y = 0
z = 1
w = n
for i in range(n - 1):
	if a[i] > a[i + 1] and x == 0:
		x = 1
		y += 1
		z = i + 1
	if a[i] < a[i + 1] and x == 1:
		y += 1
		x = 0
		w = i + 1
if y > 2:
	print('no')
else:
	if y == 0:
		w = z
	if b == a[:z - 1] + a[z - 1:w][::-1] + a[w:]:
		print('yes')
		print(z, w)
	else:
		print('no')


n = int(input())
a = [int(x) for x in input().split()]
b = a[:]
c = []
d = []
a.sort()
for i in range(n):
	if b[i] != a[i]:
		c.append(int(i))
if len(c) == 0:
	print('yes')
	print('1', '1')
else:
	d = b[:c[0]] + b[c[len(c) - 1]:c[0] - 1:-1] + b[c[len(c) - 1] + 1:n] if c[0] > 0 else b[:c[0]] + b[c[len(c) - 1]::-1] + b[c[len(c) - 1] + 1:n]
	if d != a:
		print('no')
	else:
		print('yes')
		print(c[0] + 1, c[len(c) - 1] + 1)


n = int(input())
a = list(map(int, input().split()))
temp = sorted(a)
if temp == a:
	print('yes')
	print(1, 1)
else:
	s = 0
	e = 0
	for i in range(n):
		if a[i] != temp[i]:
			s = i
			break
	for i in range(s, n):
		if a[s] < a[i]:
			e = i - 1
			break
	if e == 0:
		e = n - 1
	mark = a[s:e + 1]
	mark = mark[::-1]
	a[s:e + 1] = mark
	if a == temp:
		print('yes')
		print(s + 1, e + 1)
	else:
		print('no')


n = int(input())
L = list(map(int, input().split()))
X = sorted(L)
if X == L:
	print('yes')
	print(1, 1)
else:
	for i in range(n):
		if L[i] != X[i]:
			j = X.index(L[i])
			L[i:j + 1] = L[i:j + 1][::-1]
			if L == X:
				print('yes')
				print(i + 1, j + 1)
			else:
				print('no')
			break


n = int(input())
l1 = list(map(int, input().split()))
l2 = l1.copy()
l2.sort()
l3 = l1.copy()
l3 = l3[::-1]
l4 = l1.copy()
l4.sort(reverse=True)
c1 = 0
c2 = 0
nindex = 0
xindex = 0
for i in range(n):
	if l1[i] != l2[i] and c1 == 0:
		nindex = i
		c1 = 1
	if l3[i] != l4[i] and c2 == 0:
		xindex = n - i - 1
		c2 = 1
	if c2 == 1 and c1 == 1:
		break
l5 = []
l6 = []
l7 = []
for i in range(n):
	if i < nindex:
		l5.append(l1[i])
	elif i > xindex:
		l7.append(l1[i])
	else:
		l6.append(l1[i])
l6 = l6[::-1]
l8 = l5 + l6 + l7
if l8 == l2:
	print('yes')
	print(nindex + 1, xindex + 1)
else:
	print('no')


n = int(input())
array = list(map(int, input().split()))
sort = sorted(array).copy()
if array == sort:
	print('yes')
	print(*(1, 1))
	exit()
if array == sort[::-1]:
	print('yes')
	print(*(1, n))
	exit()
dsc = False
ind = None
last = -1
for i in range(n):
	if not dsc:
		if array[i] < last:
			dsc = True
			ind = i
		last = array[i]
	else:
		if array[i] > last:
			if array[i:] == sort[i:]:
				print('yes')
				print(*(ind, i))
			else:
				print('no')
			exit()
		last = array[i]
if dsc:
	if array[:ind - 1] + array[ind - 1:][::-1] == sort:
		print('yes')
		print(*(ind, n))
	else:
		print('no')
else:
	print('no')


from sys import stdin, stdout
import bisect

def st():
	return list(stdin.readline())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	n = inp()
	l = li()
	k = sorted(l)
	if k == l:
		print('yes')
		print(1, 1)
	elif l == k[::-1]:
		print('yes')
		print(1, n)
	else:
		for i in range(n):
			if l[i] != k[i]:
				p = i
				break
		for j in reversed(range(n)):
			if l[j] != k[j]:
				q = j
				break
		x = l[p:q + 1]
		l = l[:p] + x[::-1] + l[q + 1:]
		if l == k:
			print('yes')
			print(p + 1, q + 1)
		else:
			print('no')
solve()


def main():
	n = int(input())
	ipS = input().split(' ')
	ip = [[i, int(ipS[i])] for i in range(len(ipS))]
	ip.sort(key=takeSecond)
	flag = 0
	donezo = 0
	l = 1
	r = 1
	for i in range(n):
		if ip[i][0] != i and i == n - 1:
			r = i + 1
			donezo = 1
		elif ip[i][0] != i and flag == 0:
			l = i + 1
			flag = 1
		elif ip[i][0] != i and flag == 1:
			if ip[i - 1][0] != ip[i][0] + 1 or donezo == 1:
				ret()
		elif ip[i][0] == i and flag == 1:
			if i != n - 1:
				if ip[i + 1][0] == i + 1 and donezo != 1:
					donezo = 1
					r = i
			elif donezo != 1:
				donezo = 1
				r = i
	print('yes')
	print(f'{l} {r}')

def ret():
	print('no')
	exit()

def takeSecond(item):
	return item[1]
main()


n = int(input())
a = list(map(int, input().split()))
j = 0
incre = True
for i in range(n - 1):
	if a[i] < a[i + 1]:
		continue
	incre = False
	while j < n and a[i] >= a[j]:
		j += 1
	if i < j:
		break
if incre == True:
	print('yes')
	print(1, 1, sep=' ')
else:
	old = a.copy()
	old.sort()
	a[i:j] = list(reversed(a[i:j]))
	if old == a:
		print('yes')
		print(i + 1, j, sep=' ')
	else:
		print('no')


s = int(input())
a = list(map(int, input().split()))
b = sorted(a)
l = 0
r = 0
w = 0
q = 0
for i in range(s):
	if w == 0:
		if a[i] != b[i]:
			l = i
			w = 1
	if q == 0:
		if a[s - i - 1] != b[s - i - 1]:
			r = s - i - 1
			q = 1
t = 0
for i in range(r - l):
	if b[l + i] != a[r - i]:
		t = 1
if a != b:
	if t == 1:
		print('no')
	else:
		print('yes')
		print(l + 1, r + 1, end=' ')
elif a == b:
	print('yes')
	print(1, 1, end=' ')


from sys import stdin, stdout
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
s = sorted(a)
if a == s:
	stdout.write('yes\n1 1')
	exit(0)
for i in range(n - 1):
	if a[i + 1] < a[i]:
		l = i
		break
for j in range(l, n - 1):
	if a[j + 1] < a[j]:
		r = j + 2
if a[:l] + list(reversed(a[l:r])) + a[r:] == s:
	stdout.write('yes\n')
	stdout.write(str(l + 1) + ' ' + str(r))
else:
	stdout.write('no')


n = int(input())
a = list(map(int, input().split()))
b = []
d = 0
l = -1
r = -1
for i in range(n - 1):
	if a[i] > a[i + 1]:
		b.append(i)
		if i + 1 == n - 1:
			r = i + 1
	elif len(b) > 0:
		r = i
		break
if len(b) > 0:
	l = b[0]
c = []
c = a[l:r + 1]
c.reverse()
a[l:r + 1] = c
for i in range(n - 1):
	if a[i] > a[i + 1]:
		d = 1
		break
if d == 1:
	print('no')
else:
	print('yes')
	if l == -1 and r == -1:
		print(1, 1)
	else:
		print(l + 1, r + 1)