raw_input()
s = raw_input()

if len(s) == 0:
    print("NO")
    exit()

max_idx = 0
max_c = s[0]

for idx, c in enumerate(s):
    if c < max_c:
        print("YES")
        print("%d %d" % (max_idx+1, idx+1))
        exit()
    if c > max_c:
        max_c = c
        min_idx = idx

print("NO")
