This paper considers an overlapping-generations model with pay-as-you-go social security and retirement decision making by an old agent. In addition, this paper assumes that labor productivity depreciates. Under this setting, socially optimal allocations are examined. The first-best allocation is an allocation that maximizes welfare when a social planner distributes resources and forces an old agent to work and retire as she wants. The second-best allocation is one that maximizes welfare when a social planner can use only pay-as-you-go social security in a decentralized economy. This paper finds a range of an old agent's labor productivity such that the first-best allocation is achieved in a decentralized economy. This finding differs from that in Michel and Pestieau [“Social security and early retirement in an overlapping-generations growth model”, Annals of Economics & Finance, 2013], which notes that the first-best allocation cannot be achieved in a decentralized economy.