def binary_search(array, elem, first, last):
    """
    Search for an element in an array using binary search
    :param array: array to look for element
    :param elem: the lement to look for
    :param first: the index of the first position in the array
    :param last: the index of the last position in the array
    :return: a message showing the element (if found) or "Element not found" (if not found)
    """
    if first == last:
        if array[first] == elem:
            return 'Found at %d.' % first
        return 'Element not found.'
    mid = (first + last) // 2
    if array[mid] < elem:
        return binary_search(array, elem, mid + 1, last)
    return binary_search(array, elem, first, mid)