Notwithstanding subdivision (b) of Section 594, every person who, having been convicted previously of vandalism under Section 594 for maliciously defacing with graffiti or other inscribed material any real or personal property not his or her own on two separate occasions and having been incarcerated pursuant to a sentence, a conditional sentence, or a grant of probation for at least one of the convictions, is subsequently convicted of vandalism under Section 594, shall be punished by imprisonment in a county jail not exceeding one year, or in the state prison.
Ca. Pen. Code § 594.7