Transformers Provably Solve Parity Efficiently with Chain of Thought