Posterior can be written as
Rewrite the numerator as (see Exercise (1.4.2) in Grimmett & Stirzaker or Chain rule from Wikipedia)
and apply Bayes’s formula to
After cancelling common factors, we get posterior (since and are independent)
That has turned out to be useful for my friend so I posted it here.