import sys

n = int(raw_input())

S = raw_input()
cur = 0

for i in xrange(1, len(S)):
    if ord(S[i]) < ord(S[cur]):
        print 'YES'
        print cur + 1, i + 1
        sys.exit(0)
    cur = i

print 'NO'
