def ReverseaSubstring (n, s):

    for i in range(n-1):
        
        if s[i] > s[i+1]:
            
            print "Yes"
            
            print i+2, i+1
        
            return

    print "NO"

n = input()

s = raw_input()

ReverseaSubstring(n, s)