kk=lambda:map(int,input().split())
# k2=lambda:map(lambda x:int(x)-1, input().split())
ll=lambda:list(kk())
n,l=int(input()),input()
for i in range(n-1):
	if l[i] > l[i+1]:
		print("YES")
		print(i, i+1)
		exit()
print("NO")