n=int(input())
s=input()
s=list(s)
if s==sorted(s):
    print('NO')
else:
    print("YES")
    for i in range(2,n+1):
        if s[i-2]>s[i-1]:
            print(i-1,i)
            break 
            