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