n=int(input())
a=list(input())
b=[]
ans=0
t1=0
t2=0
for i in range(n-1):
	if(a[i]>a[i+1]):
		b.append(a[i])
		b.append(a[i+1])
		ans=1
		t1=i+1
		t2=i+2
		break
if(ans==0):
	print("NO")
else:
	print("YES")
	print(t1,t2)