def find_substr_inds(s, s_len):
    for i in range(s_len - 1):
        if s[i] > s[i + 1]:
            return (i + 1, i + 2)
    return (-1, -1)

s_len = int(input())
s = input()
inds = find_substr_inds(s, s_len)
if inds == (-1, -1):
    print("NO")
else:
    print("YES")
    print(inds[0], inds[1])