from collections import defaultdict
small={'b':['a'],'c':['a','b'],'d':['a','b','c'],'e':['a','b','c','d'],'f':['a','b','c','d','e'],'g':['a','b','c','d','e','f'],'h':['a','b','c','d','e','f','g'],
'i':['a','b','c','d','e','f','g','h'],'j':['a','b','c','d','e','f','g','h','i'],'k':['a','b','c','d','e','f','g','h','i','j'],'l':['a','b','c','d','e','f','g','h','i','j','k'],
'm':['a','b','c','d','e','f','g','h','i','j','k','l'],'n':['a','b','c','d','e','f','g','h','i','j','k','l','m'],'o':['a','b','c','d','e','f','g','h','i','j','k','m','n'],
'p':['a','b','c','d','e','f','g','h','i','j','k','m','n','o'],'q':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p'],'r':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q'],
's':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r'],'t':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s'],
'u':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t'],'v':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u'],
'w':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v'],'x':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v','w'],
'y':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v','w','x'],'z':['a','b','c','d','e','f','g','h','i','j','k','m','n','o','p','q','r','s','t','u','v','w','x','y']}

def fun(string):
	for i in range(n-1):
		if string[i]!='a':
			current=string[i]
			for v in small[current]:
				if d[v]:
					for j in d[v]:
						if j>i:
							print("YES")
							return (i+1,j+1)
	return "NO"

n=int(input())
string=input()
d=defaultdict(list)
for i in range(n):
	d[string[i]].append(i)
x=fun(string)
if x!="NO":
	print(x[0],end=' ')
	print(x[1])
else:
	print(x)