Markets have rallied recently as the economy has proved sturdier than expected and as investors have latched onto artificial intelligence-related shares. Here, stock market numbers are displayed at the New York Stock Exchange on June 2. (Getty Images)