n=int(input())
s = input()
count=0
for i in range(len(s)-1):
    if s[i]>s[i+1]:
        count+=1
        print('YES')
        tup=(i+1,i+2)
        print(*tup)
        break
if count==0:
    print('NO')
