n=int(input())
s=input()
f={}
count=[0]*27
ss=[0]*len(s)
for i in range(len(s)):
    ss[i]=(ord(s[i])-96)%26
mi=min(ss)
f=0
for i in range(1,len(ss)):
    try:

        if min(ss[i+1::])<ss[i]:
            print("YES")

            print(i+1,ss[i+1::].index(min(ss[i+1::]))+i+2)

            f=1
            break
    except:
        pass
if f==0:
    print("NO")

