#!/usr/bin/env python3
import atexit
import io
import sys

_I_B = sys.stdin.read().splitlines()
input = iter(_I_B).__next__
_O_B = io.StringIO()
sys.stdout = _O_B

@atexit.register
def write():
	sys.__stdout__.write(_O_B.getvalue())


def main():
	n=int(input())
	s=input()
	mx=s[0];mxi=0
	for i in range(n):
		if mx<s[i]:
			mx=s[i]
			mxi=i
		if mx>s[i]:
			print("YES")
			print(mxi+1,i+1)
			exit(0)
	print("NO")



if __name__=='__main__':
	main()