n = int(input())
s = input()
alph = 'abcdefghijklmnopqrstuvwxyz'
d = dict(zip(list(alph), list(range(26))))

for i in range(1, n):
    if d[s[i]] < d[s[i - 1]]:
        print('YES')
        print(i, i + 1)
        break
else:
    print('NO')