NMR study on electronic and magnetic state in RTiO3 (R=La, Y)