import sys,math
from fractions import gcd
from bisect import bisect_left
from collections import defaultdict
from io import BytesIO
sys.stdin = BytesIO(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')
n = int(input())
s = input()
#arr = [int(x) for x in input().split()]

for i in range(n-1):
    if s[i] > s[i+1]:
        print('YES')
        print(str(i+1) + ' ' + str(i+2))
        exit()
print('NO')
