def a():
    n = int(input())
    s = input()

    wrong = []
    for i in range(n):
        if s[i] in wrong:
            continue
        for j in range(i+1, n):
            if s[i] > s[j]:
                print('YES')
                print(i, j)
                return
        wrong.append(s[i])

    print('NO')

a()
