Two hydroxides; which will precipitate

Jul 2014
Im struggling with this question:

Im not looking for the answer, maybe just an example of how to do a similar question. Any help you can offer is much appreciated.

Suppose two hydroxides, YOH and Z(OH)2, both have Ksp=1/0*10^-12 and that initially both Y+ and Z^2+ are present in a solution of concentrationsa of 0.0010 mol/L. WHich hydroxide precipitates first as NaOH is slowly added to the solution?

I am thinking that i need Ksp expressions for YOH and then for Z(OH)2, find the concentration of OH- that will cause the YOH to precipitate and the same for ZOH2, then the lower one will precipitate first.