import heapq
from random import randint, choice
def gen():
    n = randint(1, 20)
    return n, "".join(choice("abcdefg") for i in xrange(n))

from sys import stdin
input = stdin.readline

n = int(input())
s = input().rstrip()

worst = []
for i in xrange(n):
    if worst and ord(s[i]) < -worst[0][0]:
        print "YES"
        print worst[0][1] + 1, i + 1
        break
    heapq.heappush(worst, (-ord(s[i]), i))
else:
    print "NO"