n = int(input())
arr = list(input())
ark = arr.copy()
ark.sort()
if(ark == arr): print("NO")
else:
	print("YES")
	for i in range(n - 1):
		if(arr[i] > arr[i + 1]):
			print("{} {}" .format(i + 1, i + 2))
			quit()

	 	 	 	 	 	 			  	 	   		