It is proved that every weakly non-quasianalytic ultradifferentiable curve with values in a Frechet space E is topologically (or strongly) ultradifferentiable if and only if the space E satisfies the topological invariant (DN), thus solving a problem posed by Kriegl and Michor.