Yu-Shiba-Rusinov states in superconducting islands with finite charging energy