n=input()
r=list(raw_input())
if 1:
    f=0
    for i in range(n-1):
        if r[i]>r[i+1]:
            f=1
            break
    if f:
        print 'YES'
        print i+1,i+2
    else:
        print 'NO'
    
