Exact stationary photon distributions due to competition between one- and two-photon absorption and emission