Differential equations with a given set of solutions