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

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