A person is guilty of criminal trespass in the first degree when he knowingly enters or remains unlawfully in a building, and when, in the course of committing such crime, he:
1. Possesses, or knows that another participant in the crime possesses, an explosive or a deadly weapon; or
2. Possesses a firearm, rifle or shotgun, as those terms are defined in section 265.00, and also possesses or has readily accessible a quantity of ammunition which is capable of being discharged from such firearm, rifle or shotgun; or
3. Knows that another participant in the crime possesses a firearm, rifle or shotgun under circumstances described in subdivision two.
Criminal trespass in the first degree is a class D felony.