N = input()
S = raw_input()
curm = (S[0],0)
for i,ch in enumerate(S[1:]):
    c = (ch,i+1)
    if ch < curm[0]:
        print 'YES'
        print curm[1]+1,i+2
        exit()
    if c > curm: curm = c
print 'NO'
