Proof of the Yano-Obata conjecture for $h$-projective transformations