We announce the discovery of two planetary companions orbiting around the low mass stars Ross 1020 (GJ 3779, M4.0V) and LP 819-052 (GJ 1265, M4.5V). The discovery is based on the analysis of CARMENES radial velocity observations in the visual channel as part of its survey for exoplanets around M dwarfs. In the case of GJ 1265, CARMENES observations were complemented with publicly available Doppler measurements from HARPS. The datasets reveal one planetary companion for each star that share very similar properties: minimum masses of $8.0pm0.5$ M$_{oplus}$ and $7.4pm0.5$ M$_{oplus}$ in low-eccentricity orbits with periods of $3.023pm0.001$ d and $3.651pm0.001$ d for GJ 3779 b and GJ 1265 b, respectively. The periodic signals around three days found in the radial velocity data have no counterpart in any spectral activity indicator. Besides, we collected available photometric data for the two host stars, which confirm that the additional Doppler variations found at periods around 95 d can be attributed to the rotation of the stars. The addition of these planets in a mass-period diagram of known planets around M dwarfs suggests a bimodal distribution with a lack of short-period low-mass planets in the range of 2-5 M$_{oplus}$. It also indicates that super-Earths (> 5 M$_{oplus}$) currently detected by radial velocity and transit techniques around M stars are usually found in systems dominated by a single planet.