def solve(n,s):
    l = [(c,i) for i,c in enumerate(s)]
    l.sort()
    for i in range(1,n):
        if l[i-1][0] < l[i][0] and l[i-1][1] > l[i][1]:
            print("YES")
            print(l[i][1], l[i-1][1])
            return
    print("NO")


n = int(input())
s = input()
solve(n,s)

