def validate_max_intermediate_nodes(intermediate_nodes):
    """
    Validate if user inputs more than 2 intermediate nodes.
    :param intermediate_nodes: a list of intermediate nodes
    """
    if isinstance(intermediate_nodes, list) and len(intermediate_nodes) > 3:
        print(
            "Max number of intermediate nodes is 2. You specify {}. We can not proceed your query. Please refine your query".format(
                len(intermediate_nodes) - 1
            )
        )
        return False
    return True