The early months of 2024 have certainly brought a series of excellent market days for investors. With the S&P 500 setting multiple new records so far in 2024, many investors are feeling increasingly optimistic about putting cash into stocks compared to several months ago.

Wall Street has a habit of slipping into a bear market once every four years on average. But the good news: In every case, the market has not just recovered but also eventually reached new highs.

Bull markets tend to appear every five to six years on average, and they are usually much longer than bear markets. So if you invest in great companies, hold on to them, and keep investing during both the highs and lows, you can benefit from the best and worst days of the stock market.

On that note, if you have $1,000 to invest right now, here are two fantastic companies to consider.

1. Innovative Industrial Properties

Innovative Industrial Properties (IIPR 0.51%) is something of a unicorn in the world of marijuana stocks because it doesn't actually grow and sell pot. Instead, the company operates as a real estate investment trust (REIT).

Innovative Industrial Properties acquires cultivation facilities, distribution centers, and other related real estate from state-licensed cannabis operators. It then rents these facilities back to the operators via long-term arrangements.

This model provides recurring rental income for Innovative Industrial Properties and offers more efficiency for the operators by letting them focus on the business of growing and selling marijuana.

It's important to note that the REIT only rents to operators in the medical cannabis business, which is more regulated and enjoys much broader legalization nationwide than the recreational use market. At the time of this writing, about 90% of Innovative Industrial Properties' portfolio was rented out to multi-state operators (MSOs), and around 60% of its tenants are publicly traded companies.

In 2023, the company reported revenue of $310 million and net income of $164 million. Those two figures rose 12% and 5%, respectively, from 2022. Adjusted funds from operations -- an important measure of REIT performance -- for the year totaled $257 million, up 10% from the prior year.

As of the end of the year, the REIT had 108 properties in 19 states. Currently, 95.8% of its operating portfolio is rented via triple net leases, where the tenant pays most of the costs associated with maintaining the property in addition to rent.

Another stellar figure is the rental collection rate, which stood at 100% as of February. The company also has a superior yield and track record of raising its dividend over time. Its current yield of 7% is considerably higher than the average stock trading on the S&P 500 (1.3%), and its dividend has risen 300% over the trailing-five-year period.

The cannabis market can be a risky place to put cash, at least until there is some measure of uniform legislation on a federal level. That said, the medical cannabis niche represents a vast and growing addressable market.

Innovative Industrial Properties operates an unusual model within this industry that lends itself to steady, recurring returns for the business and its shareholders. Investors might want to consider getting a slice of the action.

2. Alibaba

Alibaba Group Holding (BABA 0.66%) has had a volatile few years. Management changes, regulatory headwinds, a difficult macroeconomic environment, and an overall deceleration in growth are just a few factors that have contributed to the stock's descent. At the time of this writing, shares are trading down by around 30% from one year ago, and about 60% from five years ago.

Alibaba is the e-commerce leader in China, a country with the world's second largest economy behind the U.S., according to the International Monetary Fund. China's e-commerce market is expected to reach a valuation of about $4 trillion by 2027.

The company accounts for about 50% of China's e-commerce market via a range of platforms including its namesake Alibaba, AliExpress, Taobao, and Tmall. It even has a growing presence in groceries and fresh goods with its retail chain Freshippo.

Alibaba also has a considerable presence in other lucrative markets including cloud infrastructure services, digital media, and entertainment. Alibaba Cloud controls about 40% of the country's cloud infrastructure market. The company planned to take its cloud segment public, but scrapped that idea late last year, which hurt its stock price.

China had some of the strictest COVID lockdowns in the world, so the gradual reopening of the economy has translated to a deceleration in growth for a market leader like Alibaba. There was also a $2.8 billion fine that Chinese regulators slapped Alibaba with a few years back in an antitrust case. In short, a range of factors have contributed to its struggles lately, some of which are outside the company's control.

China's economy is already having a robust recovery. Alibaba will benefit as these headwinds recede, and it's coming from a position of strength in market leadership and financials.

Overall revenue grew 5% to $37 billion in the most recent quarter, and the company ended the period with cash and investments of about $92 billion. For risk-tolerant investors, the huge growth opportunity remaining for Alibaba in multiple rapidly expanding markets might warrant a second look given its current discounted valuation.