def get_index_bounds(indexes):
    """Returns the bounds (first and last element) of consecutive numbers.

    Example:
    [1 , 3, 4, 5, 7, 8, 9, 10] -> [1, 3, 5, 7, 10]

    Args:
        indexes (list of int): integers in an ascending order.

    Returns:
        list of int: the bounds (first and last element) of consecutive numbers.
    """

    index_bounds = [indexes[0]]

    for i, v in enumerate(indexes):
        if i == len(indexes)-1:
            index_bounds.append(v)
            break

        if v+1 == indexes[i+1]:
            continue
        else:
            index_bounds.append(v)
            index_bounds.append(indexes[i+1])

    return index_bounds