n=gets.to_i if n > 60 puts '0'*12 else puts n.times.map(&:succ).inject(&:*) % (10**12) end