
n = int(input())
s = input()
k = ''
flag = 0
a,b = 0,0
for i in range(len(s)-1):

    if s[i]>s[i+1]:
        flag = 1
        a,b = i,i+1
        break

if flag == 0:
    print('NO')
else:
    print('YES')
    print(a+1,b+1)
