The S&P 500 fell more than 19% last year as economic uncertainty rattled investors. The benchmark index has only produced a worse return in three years since its inception in 1957: It fell nearly 30% as gasoline shortages fueled double-digit inflation in 1974; it fell 23% as aftershocks from the dot-com crash rippled through the market in 2002; and it fell 38.5% amid the global financial crisis in 2008.

However, the S&P 500 soared in the year immediately following those drawdowns. In fact, the index produced an average return of 27.1% in 1975, 2003, and 2009. That makes one thing very clear: The S&P 500 could skyrocket in 2023. But even if that doesn't happen, investors should treat the current situation as a buying opportunity. The S&P 500 is still 14% off its high, but it will recover at some point.

For that reason, now is a perfect time to buy shares of Mastercard (MA 0.01%) and Paycom Software (PAYC 1.81%).

1. Mastercard: A giant in the payments industry

Mastercard has an ironclad position in the payments industry. It operates the third-largest card payments network on the planet in terms of purchase transactions, and it ranks first alongside Visa in terms of acceptance locations. That scale is the source of two significant competitive advantages that make Mastercard virtually impervious to smaller competitors.

First, scale begets a powerful network effect. Each new merchant makes Mastercard more valuable for every cardholder, and each new cardholder makes Mastercard more valuable for every merchant. Second, scale affords the company a significant cost advantage. Mastercard could easily afford to undercut the pricing of a smaller competitor simply because it makes more money. Taken together, those advantages position the company as a key beneficiary of the secular shift toward electronic payments.

Financially, Mastercard has delivered strong growth like clockwork over the years, and that trend continued in the fourth quarter despite the challenging economic climate. Revenue jumped 12% to $5.8 billion, and earnings rose 9% to $2.62 per diluted share. That said, Mastercard could easily accelerate growth in a more favorable economic environment.

Payment card transaction volume is expected to increase at 5.7% annually to reach $79 trillion by the end of the decade, according to Nilson Report. But Mastercard is set to grow more quickly due to momentum in other areas of its business. For instance, its payments network supports account-based transactions that address a $24 trillion opportunity in business-to-business payments. The company also provides value-added services like fraud management, analytics, and consulting.

Here's the upshot: Mastercard has a nearly unshakable foothold in a growing industry. To that end, management expects revenue to grow in the low to mid teens through 2024, and the company is set to maintain that momentum in the following years. That makes its current price-to-sales ratio of 16.4 look quite reasonable, and it's certainly a discount to the five-year average of 18 times sales. That's why this stock is worth buying today.

2. Paycom Software: One of the most innovative companies in the world

Paycom specializes in human capital management (HCM) software. Its core product is payroll software, but its HCM platform also includes tools for talent acquisition, labor management, and human resources management. In a nutshell, Paycom enables businesses to manage the full employee lifecycle (i.e., hiring through retirement) from a single platform. That gives the company an edge because most organizations rely on a patchwork of point solutions from multiple vendors.

HCM software is admittedly a humdrum industry, but Paycom has still shown ingenuity in its ability to create value for customers. For instance, it launched the industry's first self-service payroll technology in 2021. The product, nicknamed Beti (Better Employee Transaction Interface), essentially automates the payroll process by requiring employees to review and approve their paychecks prior to processing. That leads to fewer payroll errors, meaning administrators waste less time fixing problems. Thanks to Beti, Fast Company recognized Paycom as one of the world's most innovative companies in 2022. It was the only payroll technology company to receive that honor.

Paycom reported strong financial results in the fourth quarter. Its customer count increased 8% to 36,561, and the total number of employees using its software increased 14% to 6.5 million. In turn, revenue climbed 30% to $371 million, and generally accepted accounting principles (GAAP) net income soared 64% to $1.38 per diluted share. As a caveat, Paycom could stumble in a more difficult labor market, but it could also accelerate growth in a more favorable economic environment.

Regardless, patient investors have good reason to be optimistic about the company in the long run. Paycom currently has just 5% of its addressable market, but the broad scope of its HCM platform and innovations like Beti should keep the company in growth mode for years to come. And with shares trading at 14.1 times sales, a discount to the five-year average of 19.9 times sales, this growth stock is worth buying today.