We constrain the rate of gas inflow into and outflow from a main-sequence star-forming galaxy at z~1.4 by fitting a simple analytic model for the chemical evolution in a galaxy to the observational data of the stellar mass, metallicity, and molecular gas mass fraction. The molecular gas mass is derived from CO observations with a metallicity-dependent CO-to-H2 conversion factor, and the gas metallicity is derived from the H{alpha} and [NII]{lambda} 6584 emission line ratio. Using a stacking analysis of CO integrated intensity maps and the emission lines of H{alpha} and [NII], the relation between stellar mass, metallicity, and gas mass fraction is derived. We constrain the inflow and outflow rates with least-chi-square fitting of a simple analytic chemical evolution model to the observational data. The best-fit inflow and outflow rates are ~1.7 and ~0.4 in units of star-formation rate, respectively. The inflow rate is roughly comparable to the sum of the star-formation rate and outflow rate, which supports the equilibrium model for galaxy evolution; i.e., all inflow gas is consumed by star formation and outflow.