def solve():
    N = int(input())
    S = list(map(ord,input()))
    pre = 0
    ans = [0, 0]
    for i,c in enumerate(S):
        if pre < c:
            pre = c
            ans[0] = i + 1
        elif pre > c:
            ans[1] = i + 1
            print('YES')
            print(*ans)
            return
    print('NO')

solve()
