#https://codeforces.com/contest/1155/problem/0

n=int(input())
s=raw_input()
flag,ma=0,0
for i in xrange(len(s)):
    if ord(s[i])>ma:
        ma=ord(s[i])
        u=i
    if ord(s[i])<ma:
        print"YES"
        print u+1,i+1
        flag=1
        break
if flag==0:
    print "NO"

    
