def main():
    n = int(input())
    s = input()
    for i in range(1, len(s)):
        if ord(s[i]) < ord(s[i - 1]):
            print('YES')
            print(i, i + 1)
            return 0
    print('NO')


main()
