def compare_pivot(pivot1, pivot2):
    """
    Compare pivot1 and pivot2 regardless of the sequence
    """
    if pivot1 == pivot2 or pivot1 == [pivot2[-1], pivot2[0]]:
        return True
    else:
        return False