n = int(input())
s = list(input())

flag = False
ans = 0
for i in range(len(s)-1):
	if(s[i]>s[i+1]):
		s[i],s[i+1] = s[i+1],s[i]
		flag = True;
		ans = i
		break
if(flag):
	print("YES")
	print(i+1,i+2)
else:
	print("NO")