from sys import stdin
input = stdin.readline

n = int(input())
s = input()[:-1]

if sorted(s) == list(s):
    print "NO"
else:
    print "YES"
    worst = min(s)
    left = -1
    for i in xrange(n):
        if s[i] != worst:
            left = i
            break
    for i in xrange(left + 1, n):
        if s[i] == worst:
            print left + 1, i + 1
            break