import sys
num = int(input())
word = input()
prev = word[0]
for i in range(1, num):
    if word[i] < prev:
        print('YES')
        print(i, i+1)
        sys.exit()
    else:
        prev = word[i]
print('NO')