def sv():
    N = int(input())
    S = input()
    bi = 0
    for i in range(1, len(S)):
        if S[i] < S[bi]:
            print('YES')
            print('%d %d' % (bi+1, i+1))
            return
        if S[i] > S[bi]: bi = i
    print('NO')
sv()
