Exact discovery is polynomial for sparse causal Bayesian networks