# https://codeforces.com/problemset/problem/1155/A

n = int(input())
s = str(input())
flag = False

for idx, x in enumerate(s[1:]):
    if s[idx] > x:
        print("YES")
        print(str(idx+1)+" "+str(idx+1+1))
        flag = True
        break

if not flag:
    print("NO")
