A time of flight-energy (TOF-E) telescope is often used to detect the scattered and recoiled atoms in elastic recoil detection analysis. The experimental two-dimensional TOF-E histogram may be numerically transformed into a time of flight-mass (TOF-M) histogram. The limited mass resolution in the TOF-M histogram, which results from the limited energy resolution of the energy detector, makes it sometimes difficult to discriminate elements with a small difference in atomic mass. We describe a mass discrimination procedure to numerically discriminate the elements in the TOF-M histogram. The procedure is illustrated on a sample consisting of an Al and a Si layer deposited on a MgO substrate. Besides, we apply the procedure to discriminate Al and Si in a sample consisting of Al2O3 deposited on MoS2/SiO2/Si.