<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_valid_solution(solution, events, slots):
 """Take a solution and return whether it is valid for the given constraints Parameters solution: list or tuple a schedule in solution form events : list or tuple of resources.Event instances slots : list or tuple of resources.Slot instances Returns ------- bool True if schedule is a valid solution """

    if len(solution) == 0:
        return False
    array = converter.solution_to_array(solution, events, slots)
    return is_valid_array(array, events, slots)