Studies of close-in planets orbiting M dwarfs have suggested that the M dwarf radius valley may be well-explained by distinct formation timescales between enveloped terrestrials, and rocky planets that form at late times in a gas-depleted environment. This scenario is at odds with the picture that close-in rocky planets form with a primordial gaseous envelope that is subsequently stripped away by some thermally-driven mass loss process. These two physical scenarios make unique predictions of the rocky/enveloped transitions dependence on orbital separation such that studying the compositions of planets within the M dwarf radius valley may be able to establish the dominant physics. Here, we present the discovery of one such keystone planet: the ultra-short period planet TOI-1634 b ($P=0.989$ days, $F=121 F_{oplus}$, $r_p = 1.790^{+0.080}_{-0.081} R_{oplus}$) orbiting a nearby M2 dwarf ($K_s=8.7$, $R_s=0.45 R_{odot}$, $M_s=0.50 M_{odot}$) and whose size and orbital period sit within the M dwarf radius valley. We confirm the TESS-discovered planet candidate using extensive ground-based follow-up campaigns, including a set of 32 precise radial velocity measurements from HARPS-N. We measure a planetary mass of $4.91^{+0.68}_{-0.70} M_{oplus}$, which makes TOI-1634 b inconsistent with an Earth-like composition at $5.9sigma$ and thus requires either an extended gaseous envelope, a large volatile-rich layer, or a rocky portion that is not dominated by iron and silicates to explain its mass and radius. The discovery that the bulk composition of TOI-1634 b is inconsistent with that of the Earth favors the gas-depleted formation mechanism to explain the emergence of the radius valley around M dwarfs with $M_slesssim 0.5 M_{odot}$.