def find(s):
    from collections import defaultdict
    dic=defaultdict(list)
    for i in range(len(s)):
        dic[s[i]]+=[i]
    for i in range(26):
        c=chr(i+97)
        ans=[]
        for j in range(len(dic[c])-1,0,-1):
            if dic[c][j]-1>dic[c][j-1]:
                ans=[dic[c][j-1]+1+1,dic[c][j]+1]
                break
        
        if ans==[]:
            continue
        else:
            break
    
    if ans==[]:
        return []
    
    return ans
        
input()
s=input()
ans=find(s)
if ans==[]:
    print("NO")
else:
    print("YES")
    print(*ans)
