Sure, but you can’t practically hoard beans against the collapse of society, and you have to live in society until it collapses.
In the meantime, the stock market represents human activity - as long as there are more people doing more things with the tools and technology built by previous generations, stock market is going to trend up.