#!/usr/bin/python
# -*- coding: UTF-8 -*-2
import sys

if __name__=="__main__":
    T = int(input())
    s = input()
    pre = s[0]
    tag=0
    for i in range(1, T):
        if s[i]>=pre:
            pre=s[i]
        else:
            tag=1
            print('YES')
            print(i, i+1)
            break
    if tag==0:
        print('NO')
