import sys
n = int(sys.stdin.readline())
s = list(sys.stdin.readline())
s = s[:-1]
for i, c in enumerate(s):
    if i > 0:
        if s[i-1] > s[i]:
            sys.stdout.write("YES\n")
            sys.stdout.write(str(i) + " " + str(i+1))
            sys.exit(0)
sys.stdout.write("NO")
