n=int(input())
s=input()
flag=True
l,r=-1,-1
for i in range(0,len(s)-1):
	if(s[i]>s[i+1]):
		l,r=i,i+1
		flag=False
		break
print("YES") if not flag else print("NO")
if l!=-1:
	print(l+1,r+1)
		 	  	 	   			  	      		    	