n=int(input())
string=list(input())
x=[]
for i in string:
    x.append(i)
string.sort()
if string==x:
    print("NO")
else:
    print("YES")
    index1=0;index2=0
    for i in range(n-1):
        if x[i]>x[i+1]:
            index1=i+1;index2=i+2
            break
    print(index1,index2)
    
