n = int(input())

s = input()

t = ''.join(sorted(s))

if t == s:
    print('NO')
else:
    cur = 0

    for i in range(1, n):
        if s[i] < s[cur]:
            print('YES')
            print(cur+1, i+1)
            break
        else:
            cur = i




