Nonmonotonic dependence of polymer-glass mechanical response on chain bending stiffness