Section 26. Whoever, knowing that he is not a qualified voter in any place, wilfully votes or attempts to vote therein; whoever votes or attempts to vote more than once on his own name, his name having been registered more than once; whoever votes or attempts to vote in more than one voting precinct or town, his name having been registered in more than one voting precinct or town; whoever votes or attempts to vote in any name other than his own, or knowingly casts or attempts to cast more than one ballot at one time of balloting; or whoever votes or attempts to vote otherwise illegally, shall be punished by a fine of not more than ten thousand dollars or by imprisonment for not more than five years, or both.