Cascaded second-order nonlinearity in an optical cavity