import qualified Data.IntMap as IM
main=print.solve=<<readLn
solve n=IM.foldr(\i s->(i+1)*s`mod`(10^9+7))1$foldr f IM.empty[2..n]
f k m=foldr(\i->IM.insertWith(+)i 1)m$g 2 k
g i k
  |k==1=[]
  |r==0=i:g i q
  |i*i>k=[k]
  |otherwise=g(i+1)k
  where(q,r)=divMod k i