#####################################   
import atexit, io, sys, collections, math, heapq, fractions
buffer = io.BytesIO() 
sys.stdout = buffer
@atexit.register 
def write(): sys.__stdout__.write(buffer.getvalue())   
#####################################



n = int(raw_input())
s = raw_input()


def f(s):
	i = 1
	while(i < len(s) and s[i] >= s[i-1]): i += 1
	if i == len(s):
		print 'NO'
		return 
	print 'YES'
	print i,i+1


f(s)