n = input()
s = input()
def is_lex(s):
    result ="NO"
    for x in range(len(s)):
        for y in range(x, len(s)):
            if s[:x]+s[x:y][::-1]+s[y:] < s:
                result = "YES\n{0} {1}".format(x, y)
    return result
print(is_lex(s))