#https://codeforces.com/problemset/problem/1155/A
length = input()
s = input()

out = -1
for k in range(1, len(s)):
    if s[k] < s[k - 1]:
        out = k
        break
if out == -1:
    print("NO")
else:
    print("YES")
    print(str(k) + " " + str(k + 1))

