import sys

input = sys.stdin.readline


n = int(input())
s = list(input())

if s == sorted(s):
    print('NO')
else:
    i = 0
    while s[i] <= sorted(s)[i]:
        i += 1
    j = i + 1
    while s[j] > s[i]:
        j += 1
    print('YES')
    print(i + 1, j + 1)
