for _ in range(1):
    n=int(input())
    s=input()
    # lst=list(map(int,input().split()))
    ch=-1
    for i in range(1,n):
        if(s[i]<s[i-1]):
            print("YES")
            print(i,i+1)
            ch=1
            break
    if(ch==-1):
        print("NO")
