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