Context. Gravity waves redistribute energy and momentum between the lower and upper atmosphere, thus providing vertical coupling between layers, and they affect the state, dynamics, and variability of the upper atmosphere. The statistics of gravity wave activity on Mars is poorly explored but is required in order to characterize the atmospheric circulation and to constrain numerical models. Aims. We present the gravity wave statistics accumulated over two Martian years: from the second half of Martian year 34 to the middle of Martian year 36 (May 2018 to February 2022). The statistics includes seasonal and latitude distributions of the wave potential energy and drag, serving to represent the wave activity and impact on the atmospheric dynamics. Methods. The observations were performed by the middle- and near-infrared spectrometers of the Atmospheric Chemistry Suite on board the ExoMars Trace Gas Orbiter. The temperature profiles we obtained independently from both channels during simultaneous measurements show a good agreement, thus providing verification and enhancing confidence in the data. The gravity wave parameters included amplitudes of temperature fluctuations, potential energy per unit mass, and wave drag. These parameters were retrieved at altitudes up to 160 and 100 km from the middle- and near-infrared channels, respectively. Results. A comparison of the data obtained during the global dust storm of Martian year 34 with the corresponding period of Martian year 35 without a storm revealed a reduction of wave activity in mid-latitudes, which is in agreement with previous observations, and enhancement in the polar regions of the southern hemisphere, which was not predicted by simulations with a high-resolution circulation model.