rr = raw_input
N = int(rr())
S = rr()

def solve(N, S):
    A = [ord(c)-ord('a') for c in S]
    m = N-1
    for i in xrange(N-2, -1, -1):
        if A[i] > A[m]:
            return [i, m]
        if A[i] < A[m]:
            m = i
    return []
        
ans= solve(N, S)
if ans:
    print "YES"
    print "{} {}".format(*ans)
else:
    print "NO"
