Yes, you can get a combination ujoint to fit both sizes, they're sometimes called 'jumper joints'. Jeep used different sizes based mostly on year. It's likely a 1310/1330 combination ujoint, I run one on the rear of my YJ.
You can also swap out pinion yokes if you still have the rear axle (be careful not to damage the crush sleeve) but the combo joint is an easier route.