Controlled length-dependent interaction of Majorana modes in Yu-Shiba-Rusinov chains