If p=3, then a≥3, but a=3 gives a!−26<0, impossible because mo>0; hence a≥4. Direct computation gives a=4⇒mo=4, so (m,o)=(2,2); and a=5⇒mo=100, so (m,o)=(10,2). For a≥6, 16∣a!, so mo≡−20≡12(mod16), forcing m even; if 4∣m or o≥3 then 8∣mo, contradicting mo≡4(mod8); and if m≡2(mod4) with o=2, then m2≡4(mod16), so m2+20≡8(mod16)=0≡a!(mod16). Thus a≥6 is impossible, leaving exactly the two solutions above.