ln = int(input())
string = str(input())

max_letter = '\0'
i_max_letter = -1

for i in range(len(string)):
    if string[i] < max_letter:
       print ('YES')
       print ('%s %s' % (i_max_letter + 1, i + 1))
       exit()
    if max_letter < string[i]:
        max_letter = string[i]
        i_max_letter = i

print ('NO')
