Careful MMuellenbach, as ScottSchnoll says. Only Microsoft 365 Enterprise licenses which contains "Extended Use Rights". Look for document "Microsoft 365 Enterprise Licensing Guide" and Microsoft Product Terms from February 2024 for example.
There is a "On-premises server rights: The following rights are included with all Microsoft 365 E3 and E5 User Subscription License (USL) when purchasing through an EA/EAS Enrollment (these use rights are not including when purchasing through the Microsoft Customer Agreement or Web Direct): Exchange Server, SharePoint Server, Skype for Business Server."
This is updated and different from previous document where "On-premises server rights: The following rights are included with all Microsoft 365 E3 and E5 User Subscription License (USL): Exchange Server, SharePoint Server, Skype for Business Server." but this was in Enterprise Agreement section chapter which most people does not look.
But always look and study official and up-to-date Microsoft Licensing Documents.