n = int(input())
s = input()
import sys
for i in range(1,n):
	if ord(s[i]) < ord(s[i-1]):
		
		#d = s[:(i - 1)] + s[i] + s[i - 1] + s[i:]
		print("YES")
		print(i, end =  " " )
		print(i + 1)
		#print(d)
		sys.exit(0)
print("NO")
