Recent detection of gravitational waves from a neutron star (NS) merger event GW170817 and identification of an electromagnetic counterpart provide a unique opportunity to study the physical processes in NS mergers. To derive properties of ejected material from the NS merger, we perform radiative transfer simulations of kilonova, optical and near-infrared emissions powered by radioactive decays of r-process nuclei synthesized in the merger. We find that the observed near-infrared emission lasting for > 10 days is explained by 0.03 Msun of ejecta containing lanthanide elements. However, the blue optical component observed at the initial phases requires an ejecta component with a relatively high electron fraction (Ye). We show that both optical and near-infrared emissions are simultaneously reproduced by the ejecta with a medium Ye of ~ 0.25. We suggest that a dominant component powering the emission is post-merger ejecta, which exhibits that mass ejection after the first dynamical ejection is quite efficient. Our results indicate that NS mergers synthesize a wide range of r-process elements and strengthen the hypothesis that NS mergers are the origin of r-process elements in the Universe.