from sys import stdin
n=int(stdin.readline().rstrip())
s=stdin.readline().rstrip()
for i in range(n-1):
    if s[i]>s[i+1]:
        print("YES")
        print(str(i+1)+" "+str(i+2))
        exit()
print("NO")