n = int(input().strip())
s = input().strip()
if list(s) == list(sorted(s)):
	print('NO')
else:
	print('YES')
	x = ''.join(sorted(s))
	for i in range(n):
		if x[i] != s[i]:
			ind = i
			break
	for i in range(ind+1, n):
		if s[i] < s[ind]:
			print(ind+1, i+1)
			break