Recent studies show that the comic star-formation history has a peak epoch at z=1-3 ("Cosmic high noon"). It is also known that the AGN activity is the highest and the well-ordered morphology such as the "Hubble sequence" emerges in this redshift range. Gas metallicity, which is normally measured from strong optical emission lines, is also an important parameter for understanding the past star-formation activity including gas inflow and outflow. Measuring metallicity of a large sample of galaxies at z>1, however, is difficult because the emission lines used to evaluate the metallicity are redshifted to NIR wavelength regime. Recently, we conducted a large NIR survey by using Fibre-Multi Object Spectrograph (FMOS) on the Subaru Telescope. We detected significant Ha emission lines of ~340 star-forming galaxies at z=1.2-1.6 in the Subaru XMM-Newton Deep Survey and UKIDSS Ultra Deep Survey (SXDS/UDS) field. The metallicity is measured from the [NII]/Ha line ratio, and the correlation between stellar mass and metallicity (mass-metallicity relation) in this redshift range is examined. Comparing to the previous observational results, the mass-metallicity relation evolves smoothly from z~3 to z~0.1, i.e., the metallicity increases with decreasing redshift at a fixed stellar mass. The obtained mass-metallicity relation is in good agreement with the prediction of a cosmological simulation with strong galactic wind models. We examined the gas inflow and outflow rates from the obtained metallicity, stellar mass, and the gas mass fraction (derived from Ha luminosity assuming the Kennicutt-Schmidt law) by comparing to a simple analytic model of chemical evolution. We found that the inflow and outflow rates are comparable to or larger than the SFR. By applying the same method to the sample in the previous works at z~0 and z~2, we also found that both inflow rate and outflow rates increase with increasing redshift, which indicates that the gas flowing process is more active at higher redshift.