n = int(input())
s = input()

sor_s = sorted(s)
if "".join(sor_s) == s:
    print("NO")
else:
    for i, (char1, char2) in enumerate(zip(s, sor_s), start=1):
        if char1 > char2:
            print("YES")
            print(i, i+1)
            break



