The two-photon excitation is studied by the full relativistic theory of H2O and HLi. The single-photon excitation of H2O and HLi molecules is also studied using symmetry adapted cluster/configuration interaction (SAC-CI) method for comparison. The excitation probability of two-photon excitation is 3~5 orders of magnitude less than that of single-photon excitation. It is better to use the full relativistic theory, which involves both space and time symmetry, for the calculation of two-photon excitation.