n=gets.to_i;p n>49 ?0:(1..n).inject(:*)%1000000000000