Every person who willfully and lewdly, either:
is guilty of a misdemeanor.
Every person who violates subdivision 1 of this section after having entered, without consent, an inhabited dwelling house, or trailer coach as defined in Sectionof the Vehicle Code, or the inhabited portion of any other building, is punishable by imprisonment in the state prison, or in the county jail not exceeding one year.
Upon the second and each subsequent conviction under subdivision 1 of this section, or upon a first conviction under subdivision 1 of this section after a previous conviction under Section, every person so convicted is guilty of a felony, and is punishable by imprisonment in state prison.
Ca. Pen. Code § 314