Exactly solvable model with two conductor-insulator transitions driven by impurities