if __name__ == "__main__":
    n = int(input())
    s = input()
    result = -1
    for i in range(0, len(s) - 1):
        if s[i] > s[i + 1]:
            result = i
            break
    if result == -1:
        print('NO')
    else:
        print('YES')
        print(f'{i + 1} {i + 2}')