The recent successful findings of H3S and LaH10 compressed above 150 GPa with a record high Tc (above 200 K) have shifted the focus on hydrogen-rich materials for high superconductivity at high pressure. Moreover, some studies also report that transition-metal ternary hydrides could be synthesized at a relatively low pressure (∼10 GPa). Therefore, it is highly desirable to investigate the crystal structures of ternary hydrides compounds at high pressure since they have been long considered as promising superconductors and hydrogen-storage materials with a high Tc, and can be possibly synthesized at low pressure as well. In this work, combining state-of-the-art crystal structure prediction and first-principles calculations, we have performed extensive simulations on the crystal structures of YSHn (n = 1–10) compounds from ambient pressure to 200 GPa. We uncovered three thermodynamically stable compounds with stoichiometries of YSH, YSH2, and YSH5, which became energetically stable at ambient pressure, 143, and 87 GPa, respectively. Remarkably, it is found that YSH contains monoatomic H atoms, while YSH2 and YSH5 contain a mixture of atomlike and molecular hydrogen units. Upon compression, YSH, YSH2, and YSH5 undergo a transition from a semiconductor to a metallic phase at pressures of 168, 143, and 232 GPa, respectively. Unfortunately, electron–phonon coupling calculations reveal that these compounds possess a weak superconductivity with a relatively low Tc (below 1 K), which mainly stem from the low value of density of states occupation at the Fermi level (EF). These results highlight that the crystal structures play a critical role in determining the high-temperature superconductivity.