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

def solve():
    seen = [-1] * 26
    for i in range(n):
        cur = s[i]
        seen[ord(cur) - ord('a')] = i
        for j in range(ord(cur) - ord('a') + 1, 26):
            if seen[j] != -1:
                print('YES')
                print(seen[j] + 1, i + 1)
                return
    print('NO')

solve()