Can you buy a stock valued at lower than its cash (which is all it has on the bal sht)

If
a) a company/stock has just cash (because it has sold it’s business), and
b) is then looking to buy another business with that cash, and
c) the market cap is LOWER than the cash

Is that halal to buy.

It’s not an SPAC but a similar situation I think…