
import math

size=int(input())
string=str(input())
 
so=sorted(string)

if len(string)==1:
	print("NO")

if so == list(string):
	print("NO")


for i  in range(1,len(string)):
	if string[i]<string[i-1]:
		print("YES")
		print(i,i+1)
		break

