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

sor_s = sorted(s)
if "".join(sor_s) == s:
    print("NO")
else:
    for i in range(1, n):
        if s[i-1] > s[i]:
            print("YES")
            print(i, i+1)
            break



