n = int(input())
s = input()
new_s = ''.join(sorted(s))
if new_s == s:
    print("NO")
else:
    for i in range(n):
        if new_s[i] != s[i]:
            print("YES")
            print(i + 1, i + 1 + s[i + 1:].index(new_s[i]) + 1)
            break
