import sys

n = int(raw_input())

inputStr = raw_input()


arr  = [-1 for x in range(26)]


for idx,c in enumerate(inputStr):
    arr[ord(c) - ord('a')] = idx


for idx,c in enumerate(inputStr):
    o = ord(c) - ord('a')
    for jdx in range(o):
        if arr[jdx] > idx:
            print "YES"
            print idx+1,arr[jdx]+1
            exit
            sys.exit()

print "NO"
