n=int(input())
s=input()
cur=s[0]
idx=0
pos=0
for i in range(1,n):
	if ord(s[i])<ord(cur):
		pos=1
		l=idx+1
		r=i+1
		break
	else:
		idx=i
		cur=s[i]
if pos==0:
	print("NO")
else:
	print("YES")
	print("{} {}".format(l,r))
