A well-known theorem in topology says that for a smooth manifold $M$ of dimension $n$ the map $f: M \rightarrow point$ satisfies
$$f^! \mathbf R = \mathbf R[n]$$
Here $\mathbf R$ is the constant sheaf.

Here is my question: is there any kind of converse statement to this? (I.e. if $f$ is such that the above equation holds, is $M$ smooth? I don't expect this implication to hold literally, any partial or weakened statement is OK, too.)