'''input
6
aabcfg
'''
from sys import stdin, stdout
import math
from copy import deepcopy
from collections import defaultdict
import heapq


# main starts
n = int(stdin.readline().strip())
string = list(stdin.readline().strip())
for i in range(1, len(string)):
	if string[i - 1] <= string[i]:
		continue
	else:
		string[i - 1], string[i] = string[i], string[i - 1]
		print('YES')
		print(i, i + 1)
		break
else:
	print("NO")
