n = int(input())
s = input()
flag = 0
for ind, character in enumerate(s[1:]):
    if s[ind + 1] < s[ind]:
        flag = 1
        print('YES')
        print(ind + 1, ind + 2)
        break
if flag == 0:
    print('NO')
