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

n = int(input())
s = input()
f = False
for i in range(n-1):
    if s[i] > s[i+1]:
        f = (i+1,i+2)
        break
if f:
    print('YES')
    print(f[0], f[1])
else:
    print('NO')