Section 20. Whoever steals in a building, ship, vessel or railroad car shall be punished by imprisonment in the state prison for not more than five years or by a fine of not more than five hundred dollars or by imprisonment in jail for not more than two years.