import sys
sys.setrecursionlimit(10 ** 6)
# pow(3,2,5)==4

inp=input()
inp2=raw_input()
last=inp2[0]
flag=0
for x,i in enumerate(inp2[1:],1):
    if (ord(i)>ord(last)):
        flag=1
        print "YES"
        print x,x+1
        break
if not flag:
    print "NO"
