def substring(s):
    for i in range(len(s)):
        if i + 1 < len(s) and s[i + 1] < s[i]:
            return ["YES", [i + 1, i + 2]]
    return ["NO"]


n = int(input())
t = input()
if len(substring(t)) == 2:
    print(substring(t)[0])
    print(*substring(t)[1])
else:
    print(*substring(t))
