def main():
    l = int(input())
    s = input()

    smallest = 97
    index = 0
    while index < len(s):        
        if ord(s[index]) == smallest:
            index += 1
            continue
        target =  s.rfind(chr(smallest), index+1)
        if target > index:
            print("YES")
            print(index+1, target+1)
            return
        else:
            smallest += 1
    print("NO")

main()
            
