def binary_search(lis, elem, start, end):
    """
    Return index of matched position of elem in lis between index start and end (inclusive) or return -1
    :param lis: Sorted list
    :param elem: element to search
    """
    assert 0 <= start <= end < len(lis)
    if end == start:
        # If there is only one element to search, check that element only
        if lis[start] == elem:
            return start
        return -1

    mid = (start + end) // 2
    mid_elem = lis[mid]
    if mid_elem == elem:
        return mid
    if mid_elem < elem:
        # If middle element is less than our required element then search in the right of array
        if end > mid:
            return binary_search(lis, elem, mid + 1, end)
        return -1
    if mid_elem > elem:
        # If middle element is larger than our required element then search in the left of array
        if start < mid:
            return binary_search(lis, elem, start, mid - 1)
        return -1