We measure the anisotropic mid-infrared response of electrons and phonons in bulk YBa2Cu3O7 after femtosecond photoexcitation. A line shape analysis of specific lattice modes reveals their transient occupation and coupling to the superconducting condensate. The apex oxygen vibration is strongly excited within 150 fs demonstrating that the lattice absorbs a major portion of the pump energy before the quasiparticles are thermalized. Our results attest to substantial electron-phonon scattering and introduce a powerful concept probing electron-lattice interactions in a variety of complex materials.