let rec repeat_while f a =
  match f a with
  | None -> a
  | Some a -> repeat_while f a

let rec factors acc = function
  | [] -> acc
  | x :: xs ->
      let xs' =
        List.map (fun y -> repeat_while (fun (y, n) ->
          if y mod x = 0 then Some (y / x, n + 1) else None) (y, 0)) xs in
      factors (List.fold_left ( + ) 1 (List.map snd xs') :: acc) @@ List.filter (( <> ) 1) @@ List.map fst xs'
let factors = factors []

let n = 1000000007
let ( *^ ) x y = (x * y) mod n

let () = Scanf.scanf "%d" (fun n ->
  Array.init (n - 1) (fun i -> i + 2)
  |> Array.to_list
  |> factors
  |> List.map (( + ) 1)
  |> List.fold_left ( *^ ) 1
  |> Printf.printf "%d\n")