An isotropic component of high energy \gamma -ray spectrum measured by Fermi LAT constrains the proton component of UHECR . The strongest restriction comes from the highest , ( 580 - 820 ) GeV , energy bin . One more constraint on the proton component is provided by the IceCube upper bound on ultrahigh energy cosmogenic neutrino flux . We study the influence of these restrictions on the source properties , such as evolution and distribution of sources , their energy spectrum and admixture of nuclei . We also study the sensitivity of restrictions to various Fermi LAT galactic foreground models ( model B being less restrictive ) , to the choice of extragalactic background light model and to overall normalization of the energy spectrum . We claim that the \gamma -ray-cascade constraints are stronger than the neutrino ones , and that however many proton models are viable . The basic parameters of such models are relatively large \gamma _ { g } and not very large z _ { \max } . The allowance for H e ^ { 4 } admixture also relaxes the restrictions . However we foresee that future CTA measurements of \gamma -ray spectrum at E _ { \gamma } \simeq ( 600 - 800 ) GeV , as well as resolving of more individual \gamma -ray sources , may rule out the proton-dominated cosmic ray models .