import sys

n = int(sys.stdin.readline().rstrip())
s = list(sys.stdin.readline().rstrip())

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