"""609C"""
# import math
# import sys
def  main():
	n = int(input())
	string = str(input())
	s = list(string)
	s.sort()
	for i in range(n):
		if string[i]>s[i]:
			for j in range(i+1,n):
				if string[j]==s[i]:
					print("YES")
					print(i+1,j+1)
					return
	print("NO")
	return

main()
# def test():
# 	t= int(input())
# 	while t:
# 		main()
# 		t-=1
# test()