from sys import exit

length = int(input())
string = list(input())

for i in range(length - 1):
	if ord(string[i]) > ord(string[i + 1]):
		print("YES")
		print(str(i + 1) + " " + str(i + 2))
		exit()

print("NO")