The P0401 code is for the insufficient EGR flow. It does not mean that your EGR valve needs to be replaced. It might be just the EGR ports are clogged . Its needs to be cleaned first before replacing EGR valve.
P0420 code shows that your catalytic converter does not work as it supposed to . You should try a chemical first to clean converter if it wont help then converter needs to be replaced.