let n = Scanf.scanf "%d" (fun n -> n)

let rec f i ret =
  if i = n+1 then ret
  else
    let rec g = function
      [] -> i :: ret
    | p :: l ->
      if i mod p = 0 then ret
      else g l
    in f (i+1) (g ret)

let primes = f 2 []

let rec ans ret = function
  [] -> ret
| p :: l ->
  let rec f q x =
    if q > n then x
    else
      let rec g i x =
        if i = n+1 then x
        else if i mod q = 0 then g (i+1) (x+1)
        else g (i+1) x
      in f (q * p) (g 2 x)
  in ans (ret * (f p 1) mod 1000000007) l

let () = print_int (ans 1 primes)
