import math 
import sys 
#t=int(sys.stdin.readline())
t=1
for _ in range(t):
    n=int(sys.stdin.readline())
    s=list(input())
    a=s.copy()
    a.sort()
    if a==s:
        print("NO")
    else:
        k=[]
        print("YES")
        for i in range(n-1):
            if ord(s[i])>ord(s[i+1]):
                k.append([i,i+1])
                break
        print(k[0][0]+1,k[0][1]+1)        