With the S&P 500 up 9% year to date and up 74% over the past five years, it's fair to say that the stock market has had a good run recently. While this is great for the value of investors' holdings, it means there are fewer good buying opportunities.

But if you look close enough, there are still some companies worth buying -- even in this market. PayPal (PYPL -1.14%) and The New York Times (NYT -0.11%) stand out as two stocks that look like good long-term bets.

PayPal

After splitting off from eBay in 2015, PayPal has served investors consistently strong growth. For instance, PayPal's trailing-12-month revenue is about $11.8 billion, up from $9.2 billion in 2015. Furthermore, PayPal's trailing-12-month net income has also risen, reaching $1.5 billion, up from $1.2 billion in 2015.

PayPal headquarters

Image source: PayPal.

More importantly, PayPal's growth remains strong today. Its second-quarter revenue and EPS increased 18% and 27%, respectively. Furthermore, PayPal's active customers by the end of its second quarter soared 80% year over year to 6.5 million.

PayPal CEO Dan Schulman captured the company's excellent execution in the company's second-quarter earnings release, "Our strong results reflect PayPal's transformation from a single product to a platform company, from a vendor to a strategic partner to both merchants and ecosystem players, and from a checkout option to an increasingly more central way for consumers to manage and move their money."

PayPal's price-to-earnings ratio of 50 may seem a bit absurd at first glance, but after investors consider the company's recent strong earnings growth and PayPal's future earnings potential, the high multiple begins to seem quite reasonable -- if not too low. On average, analysts believe PayPal's EPS will increase at a compound annualized rate of 18.5% over the next five years. 

New York Times

Like PayPal, New York Times' business has grown nicely recently, driven by the company's well-executed transition to digital subscriptions and digital advertising. For its second quarter, New York Times' revenue increased 9.2% year over year to $407 million, driven primarily by a 46.4% increase in digital-only subscription revenue and a 22.5% jump in digital advertising revenue.

Man using a smartphone in the back of a car.

Image source: Getty Images.

The success of New York Times' digital subscription model is particularly evident in the company's sharp rise in digital-only subscribers. Digital-only subscribers hit 2.33 million by the end of Q2, up 63.4% year over year, and doubling its digital subscriber base over the last two years.

New York Times believes its strong growth in subscription revenue can continue. "We believe that more and more people are prepared to pay for high quality, in-depth journalism that helps them make sense of the world," said New York Times CEO Mark Thompson in the company's second-quarter press release.

New York Times' high price-to-earnings of 60 may be hard to fathom at face value. But investors should keep in mind that the company's EPS is soaring. GAAP EPS in New York Times' second quarter was $0.09, up from breakeven in the year-ago quarter. Meanwhile, New York Times adjusted EPS from continuing operations was $0.18, up from $0.11 in the year-ago quarter. Over the next five years, analysts expect New York Times' EPS to increase at a compound annual rate of about 13%.

PayPal and New York Times' exceptional business models and their strategic positions amid key growth opportunities make them good long-term bets for investors.