from sys import stdin
input = stdin.readline

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

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