n=int(input())
s=input()
af="NO"
l=-1
r=-1
for i in range(n-1):
    if s[i]>s[i+1]:
        af="YES"
        l=i+1
        r=i+2
        break
if af=="YES":
    print(af)
    print(l,r)
else:
    print(af)
    