def METHOD_NAME(
    infra_agents: int,
    product_agents: int,
    in_degrees: List[int],
    out_degrees: List[int],
) -> bool:
    for agent_number, degree in enumerate(in_degrees):
        if agent_number in infra_agents and agent_number < 2 and degree > 0:
            return False
        if agent_number in infra_agents and agent_number >= 2 and degree > 2:
            return False
    return True