n= int(input())
try:
    while(True):
        s=input()
        if(len(s)>0):
            continue
        else:
            break
except EOFError:
    pass
x=[]
y=[]
for i in s :
    x.append(i)
    y.append(i)
x.sort()

if(x==y):
    print("NO")
else:
    for i in range(len(s)):
        if(y[i+1]<y[i]):
            print("YES")
            print(i+1,end=" ")
            print(i+2)
            break
    
