#Bhargey Mehta (Sophomore)
#DA-IICT, Gandhinagar
import sys, math, queue
#sys.stdin = open("input.txt", "r")
MOD = 10**9+7

n = int(input())
x = list(input())
for i in range(1, n):
    if x[i] < x[i-1]:
        print("YES")
        print(i, i+1)
        exit()
print("NO")