Determination of Y40 and Y60 components in the shapes of rare earth nuclei