n=int(input())
s=input()
a="".join(sorted(s))
if s==a:
    print("NO")
    exit()
ch=None
idx=0
for i in range(n-1):
    if ord(s[i])>ord(s[i+1]):
        print("YES")
        print(i+1,i+2)
        exit()
print("NO")