from sys import stdin, stdout
n = int(input())
s = stdin.readline()
pret = s[0:1]
i = 1
b = False
for c in s:
    if i > 1 and c < pret and i <= n:
        print('YES')
        print(i - 1, i)
        b = True
        break
    i += 1
    pret = c
if b == False:
    print('NO')
