(a) This section does not apply to a registrant who enters real property:
(1) where the registrant is a student or the registrant’s child is a student or receives child care, if:
(i) within the past year the registrant has been given the specific written permission of the Superintendent of Schools, the local school board, the principal of the school, or the owner or operator of the registered family child care home, licensed child care home, or licensed child care institution, as applicable; and
(ii) the registrant promptly notifies an agent or employee of the school, home, or institution of the registrant’s presence and purpose of visit; or
(2) for the purpose of voting at a school on an election day in the State if the registrant is properly registered to vote and the registrant’s polling place is at the school.
(b) A registrant may not knowingly enter onto real property:
(1) that is used for public or nonpublic elementary or secondary education; or
(2) on which is located:
(i) a family child care home registered under Title 5, Subtitle 5 of the Family Law Article;
(ii) a child care home or a child care institution licensed under Title 5, Subtitle 5 of the Family Law Article; or
(iii) a home where informal child care, as defined in child care subsidy regulations adopted under Title 13A of the Code of Maryland Regulations, is being provided or will be provided to a child who does not reside there.
(c) A person who enters into a contract with a county board of education or a nonpublic school may not knowingly employ an individual to work at a school if the individual is a registrant.
(d) A person who violates this section is guilty of a misdemeanor and on conviction is subject to imprisonment not exceeding 5 years or a fine not exceeding $5,000 or both.