Theoretically, these both are not supported. But, if your motherboard manufacturer has a BIOS update available, you can use a Ryzen 5000 series CPU on a B450 motherboard. You can know more about it here.