n = input()
s = raw_input().strip()

l = []
for i in xrange(n):
    l.append((s[i], i))

l.sort()

flag = 0
for i in xrange(n):
    j = l[i][1]
    if j != i:
        flag = 1
        print "YES"
        print i + 1, j + 1
        break

if flag == 0:
    print "NO"