n = input()
s = raw_input()

a = [0] * 26
for i in xrange(n):
    a[ord(s[i]) - ord('a')] = i

z = ''
for i in range(n):
    j = ord(s[i]) - ord('a') - 1
    while j >= 0:
        if a[j] > i:
            z = '%d %d' % (i + 1, a[j] + 1)
            break
        j -= 1
    if z != '': break

if z == '':
    print 'NO'
else:
    print 'YES'
    print z
