###########################################
#  Author : Uranux   
#  Created On : Mon Apr 22 2019
#  File : A.py
###########################################

def input_s():
    return raw_input()

def input_i():
    return int(raw_input())

def input_2_i():
    arr = map(int, raw_input().split())
    return arr[0], arr[1]

def input_3_i():
    arr = map(int, raw_input().split())
    return arr[0], arr[1], arr[2]

def input_i_array():
    return map(int, raw_input().split())

def get_presum(n, arr):
    presum = [arr[0]]
    for i in range(1, n):
        presum.append(presum[i - 1] + arr[i])
    return presum

def calc(n, s):
    for i in range(n - 1):
        if s[i] > s[i + 1]:
            return 'YES', i + 1, i + 2
    return 'NO', 0, 0

"""
7
abacaba
"""

n = input_i()
s = input_s()

flag, l, r = calc(n, s)
print flag
if flag == 'YES':
    print l, r

