Should I have all 4 tyres replaced?

Currently have 2021 tyres on the rear and 2023 tyres on the front however the front left and right ones are 7 months apart or around 17,000KM. All tyres are the same model and brand and the car is fwd. Is this safe or should I have all 4 tyres changed?