The pseudogap is a central puzzle of cuprate superconductors. Its connection to the Mott insulator at low doping $p$ remains ambiguous and its relation to the charge order that reconstructs the Fermi surface at intermediate $p$ is still unclear. Here we use measurements of the Hall coefficient in magnetic fields up to 88 T to show that Fermi-surface reconstruction by charge order in YBa$_2$Cu$_3$O$_y$ ends sharply at a critical doping $p = 0.16$, distinctly lower than the pseudogap critical point at $p^* = 0.19$. This shows that pseudogap and charge order are separate phenomena. We then find that the change of carrier density from $n = 1 + p$ in the conventional metal at high p to $n = p$ at low $p$ - a signature of the lightly doped cuprates - starts at $p^*$. This shows that pseudogap and antiferromagnetic Mott insulator are linked.