Energy transfer between atoms and molecules is fundamental to many physical and chemical processes, and understanding the mechanisms and outcomes of energy transfer is crucial for various applications in physics and chemistry. Here, the rovibrational excitation of YO(X 2Σ+) molecules with the collision of Kr and Ne has been studied in the laser-ablation crossed beam and time-sliced ion velocity map imaging setup in combination with the resonance enhanced multiphoton ionization scheme. Significant changes in the angular distribution for different rovibrational excitations of YO molecules are observed with the collision of Kr. The sharp forward distribution for low rovibrational excitation of YO(v' = 0, 1) molecules suggest that the weak attractive potential between Kr and YO is dominant at large impact parameters. Comparatively, the strong sideway distribution for highly rovibrationally excited YO(v' = 1, 2, 3, and 5) is due to rainbow scattering from the stronger attractive potential of Kr···YO at relatively small impact parameters. The more isotropic angular distribution in the highly rovibrationally excited YO(v' = 11) indicates the formation of a short-lived complex. A change in the angular distribution of scattered YO with different rovibrational excitations was also observed in the collisions of Ne. For YO as a heteronuclear diatomic molecule, collisions of the Y- and the O-end of YO with rare gases would affect the contribution of inelastic processes at different impact parameters.