The Deterrence Effect of Prison: Dynamic Theory and Evidence