program main implicit none integer*8::N,i,M read *,N if(N.ge.60) then print '("000000000000")' return end if M=1 do i=1,N M = MOD(M*i,10**12_8) end do print '(i0)',M end program main