k = int(input())
s = list(map(ord, input()))
n = -1
for i in range(len(s) - 1):
    if s[i] > s[i + 1]:
        n = i
        break
if n != -1:
    print("YES")
    print(n + 1, n + 2)
else:
    print("NO")
