try:
    l=int(input())
    s=input()
    
    c=0
    for i in range(0,l):
        for j in range(l-1,i,-1):
            if(s[i]>s[j]):
                a=i
                b=j
                c=1
                break
    if(c==1):
        print("YES")
        print(a,b,end="")
    else:
        print("NO")
except:
    pass
    
            
