n = int(input())
s = input()

if sorted(s) == list(s):
    print("NO")
else:
    mx = s[0]
    cur = 0
    till = 0
    for i in range(1, n):
        if s[i] < mx:
            till = i
            break
        elif s[i] > mx:
            mx = s[i]
            cur = i
    print("YES")
    print(cur + 1, till + 1)
