Ground- and excited-state cusp conditions for the electron density