# -*- coding: utf-8 -*-
"""
Created on Thu May  9 21:36:40 2019

@author: tarushpc
"""

n=int(input())
s=input()

highest="a"
highest_index=-1
for i in range(n):
    if s[i] < highest:
        print("YES")
        print(highest_index+1,i+1)
        #print(s[0:highest_index]+reverse(s[highest_index:i+1])+s[i+1:])
        break
    else:
        highest=s[i]
        highest_index=i

if highest_index == len(s)-1:
    print("NO")

        
    