num = int(input())
word = input()

def lexboy(n, string):
    for i in range(1, n):
        if string[i] < string[i - 1]:
            return 'YES \n' + str(i) + ' ' + str(i + 1)
    return 'NO'

print(lexboy(num, word))