NMR study of ferromagnetic YTiO3 and antiferromagnetic LaTiO3