Hyperon-nucleon scattering and hyperon masses in the nuclear medium