num = input()
s = input()
# num = 6
# s = 'abacaba'
s_n = [i for i in s]
s_n.sort()
if ''.join(s_n) == s:
    print('NO')
else:
    print('YES')
    for i in range(len(s) - 1):
        if s[i] > s[i + 1]:
            print(i+1, i+2)
            break
