n = int(input())
data = input()
checker = 0

for i in range(n-1):
	if ord(data[i]) <= ord(data[i+1]):
		continue
	else:
		checker += 1		

if checker == 0:
	print('NO')
else:
	for i in range(n-1):
		if ord(data[i]) > ord(data[i+1]):
			print('YES')
			print(i+1, i+2)
			break