input()

word1 = input()


def str_reverse(word):
    for idx, letter in enumerate(word):
        if idx != len(word) - 1:
            if word[idx] > word[idx + 1]:
                print('YES')
                print(idx + 1, idx + 2)
                return

    print('NO')


(str_reverse(word1))