import string
n=int(input())
s=input()
d=dict()
ss=string.ascii_lowercase
for i,j in enumerate(s):
	d[j]=i
flag=False
for i,j in enumerate(s):
	for k in ss:
		if(k==j):
			break
		if(d.get(k,None) is not None):
			if(d[k]>i):
				print("YES")
				print(i+1,d[k]+1)
				flag=True
				break
	if(flag):
		break
if(flag==False):
	print("NO")


