def isLessLexo(strr):
    if strr[::-1] < strr:
        return True
    return False
def main():
    no = int(input())
    s = input()
    smallestlex = "abcdefghijklmzopqrstuvwxyz"
    iind,jind = 0,0
    for i in range(no):
        for j in range(no-i):
            temp = s[i:j]
            if isLessLexo(temp):
                print("YES")
                return (iind,jind)
    return "NO"
    return 
a = main()
if a == "NO":
    print(a)
else:
    print(a[0],a[1])