The reaction proceeds through the following steps:
1. Hydration of propene gives a major alcohol (2-propanol), which is oxidized to acetone (Y).
2. Aldol condensation of two acetone molecules in the presence of Ba(OH)$_2$ and heat results in 4-methylpent-3-en-2-one as the product Z.