import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

n = input()
s = raw_input()
ans = 'NO'
index = 0
for i in xrange(n-1):
	if s[i] > s[i+1]:
		ans = 'YES'
		index = i
		break
print ans
if ans == 'YES':
	print index+1, index+2