1. A person is guilty of burglary if he willfully enters or surreptitiously remains in a building or occupied structure, or a separately secured or occupied portion thereof, when at the time the premises are not open to the public and the actor is not licensed, invited, or otherwise privileged to enter or remain as the case may be, with intent to commit a crime therein.
2. Burglary is a class B felony if:
a. The offense is committed at night and is knowingly perpetrated in the dwelling of another; or
b. In effecting entry or while in the premises or in immediate flight therefrom, the actor inflicts or attempts to inflict bodily injury or physical restraint on another, or menaces another with imminent serious bodily injury, or is armed with a firearm, destructive device, or other weapon the possession of which under the circumstances indicates an intent or readiness to inflict serious bodily injury.