NMR studies of magnetic and electronic properties of La2−xMxCuO4−y (M=Ba, Sr)