n = int(input())
str = input()
ind = 1
flag = True
for i in range(len(str) - 1):
    if(str[ind] < str[ind - 1]):
        print('YES\n', ind, ' ', ind + 1, sep="")
        flag = False
        break
    ind += 1
if(flag):
    print('NO')

