def get_mode(size, numbers):
    """
    Gets the mode for N elements in an array
    Input:
    - number(array[float]): list of element to calculate the mode

    Returns:
    - res(float): mode of the elements
    """
    mode = -1
    count = 0
    count_max = 0
    prev = numbers[0]

    for element in numbers:
        if element == prev:
                count += 1
                prev = element
                mode = element
                if count > count_max:
                    count_max = count
                    mode = element
        else:
            count = 1
    
    return mode