n=int(input())
s=str(input())
boo=0
for i in range(len(s)-1):
    if(s[i]>s[i+1]):
        ind=i
        boo=i
        break
if not boo:
    print("NO")
else:
    print("YES")
    print(str(boo+i)+ " "+str(boo+2))
