No person shall, within the hours of 6:00 p.m. until 6:00 a.m. enter grounds of any public building of the City used and occupied for school purposes for the purpose of loitering there or shall, within such hours, loiter or remain upon such grounds or the sidewalks or steps of such building. This provision shall not prohibit persons from entering school property for the purposes permitted under MGL c. 71, § 71.