Connection between Yangian symmetry and the quantum inverse scattering method