
import sys,os
from collections import Counter, defaultdict


# n, k = map(int, raw_input().split())
# da = map(int, raw_input().split())
# db = map(int, raw_input().split())

n = map(int, raw_input().split())[0]
s = raw_input()
for i in range(1,n):
    # print i
    if s[i] < s[i-1]:
        print "YES"
        print i,i+1
        exit(0)
print "NO"
