def main():
    l = int(input())
    s = input()
    for index in range(1,len(s)):
        if s[index-1] > s[index]:
            print("YES")
            print(index, index+1)
            return
    print("NO")

main()
        
