def equivalent(list1, list2):
    """Ensures that two lists are equivalent, i.e., contain the same items."""
    if len(list1) != len(list2):
        return False
    set1 = set(list1)
    for item in list2:
        if item not in set1:
            return False
    return True