Whoever, being an election official or any other person, while the polls are open, opens any ballot marked by, or received from, a voter at any election, or marks a ballot by folding or otherwise so as to be able to recognize it, or otherwise attempts to discover, or, having discovered, discloses how, any person has voted, or allows the same to be done by any other person, shall be fined not more than $500 or imprisoned not more than one year, or both.