n = int(input())
s = input()
ok = 0
idx = (0, 0)
for i in range(len(s)-1):
    if ord(s[i]) > ord(s[i+1]):
        ok = 1
        idx = (i+1, i+2)
        break

if ok:
    print('YES')
    print(*idx)
else:
    print('NO')
