
from math import *

n=int(input())
s=input()

l=[]
l_=[]

for i in s: 
	l.append(i)
	l_.append(i)

l=sorted(l)


if(l==l_):
	print("NO")
	exit()

for i in range(1,n):
	if(l_[i]<l_[i-1]):
		print("YES")
		print(i,i+1)
		exit()


