n = input()

s = raw_input()

istrue = True

k = [(ord(s[i]), i) for i in range(n)]

k.sort()

for i in range(n):

    if ord(s[i]) < k[i][0]:

        istrue = False

        break

if istrue:

    print "NO"

else:

    print "YES"

    print k[i][1]+1, i+1