n=int(input())
a=input()
lo,hi=0,0
flag=0
for i in range(n-1):
    x=a[i]
    y=a[i+1]
    if x>y:
        flag=1
        lo=i+1
        hi=i+2
        break

if flag==1:
    print("YES")
    print(lo,hi)
else:
    print("NO")


