n = int(input())
S = input()
a = ord('a')
pre = -1
prei = -1
for i in range(n):
    if pre > ord(S[i]) - a:
        print('YES')
        print(prei + 1, i + 1)
        exit()
    else:
        if pre <= ord(S[i]) - a:
            pre = ord(S[i]) - a
            prei = i

print('NO')

