Whoever maliciously by the explosion of gunpowder or other explosive substance, destroys, throws down, or injures the whole or any part of any building, by means of which the life or safety of a human being is endangered, shall be fined not more than $1,000 or imprisoned not more than 5 years, or both.