def main():
    n = int(input())
    s = input()
    for i in range(1,n):
        if(s[i]<s[i-1]):
            print("YES")
            print(str(i)+' '+str(i+1))
            return
    print("NO")
    return
main()