
n=int(input())

str1=input()
count=0
for i in range(len(str1)-1):
	if(ord(str1[i])<=ord(str1[i+1])):
		count=count+1
	else:
		a=i
		b=i+1
if(count==n-1):
	print("NO")
else:
	print("YES")
	print(a+1,b+1,end=" ")
