#import resource
import sys
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.Thread(target=main).start()
#threading.stack_size(2**26)
#sys.setrecursionlimit(10**6)
mod=(10**9)+7
#fact=[1]
#for i in range(1,1001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*1001
#ifact[1000]=pow(fact[1000],mod-2,mod)
#for i in range(1000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import math
import heapq
from random import randint as rn
from Queue import Queue as Q
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p):
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t
def ain():
    return map(int,sin().split())
def sin():
    return stdin.readline().strip()
def GCD(x,y):
    while(y):
       x, y = y, x % y
    return x
def isprime(x):
    if(x<4 and (x==2 or x==3) ):
        return True
    else:
        return False
    for i in range(2,int(math.sqrt(x))+1):
        if(x%i==0):
            return False
    return True
"""**************************************************************************"""
n=input()
s=sin()
t=-1
for i in range(n-1):
    if(s[i]>s[i+1]):
        t=i
        break
if(t==-1):
    print "NO"
else:
    print"YES"
    print t+1,t+2
