P0420 is low catalytic converter function. P0171 is too lean condition. They are possibly related, look for a vacuum leak.

How's the car running?