n = int(input())
s = list(map(ord, list(input())))

flag = 0
for i in range(n-1):
    if s[i+1] >= s[i]:
        continue
    else:
        flag = 1
        ans = [i+1, i+2]
        break
if flag == 0:
    print("NO")
else:
    print("YES")
    print(ans[0], ans[1])
