Simulation of excited states and the sign problem in the path integral Monte Carlo method