The idea is that each $\vec{y}_k$ depends on $\vec{w}$. Therefore for the first equation, simply apply the chain rule for each $\vec{y}_k$ and sum them up:
$$\frac{dL}{d\vec{w}}=\sum_k{\frac{dQ}{d\vec{y}_k}\cdot\frac{\partial \vec{y}_k}{\partial \vec{w}}} \tag{*}$$
Maybe the order in which they appear multiplying each other has confused you.

The second is obtained supposing that the function $\vec{y}_{k}$ can be put as a function of $\vec{y}_{k+1}$ (your first equation suggets this). Therefore the derivative in $(*)$ can be expressed as:
$$\frac{dQ}{d\vec{y}_k}=\frac{dQ}{d\vec{y}_{k+1}}\cdot\frac{\partial \vec{y}_{k+1}}{\vec{y}_k}$$