A person does not violate section 609.561, 609.562, 609.563, or 609.5641 if the person sets a fire pursuant to a validly issued license or permit or with written permission from the fire department of the jurisdiction where the fire occurs.