let rec range left right =
    let rec _range left right a =
        if left >= right then a else _range left (right - 1) (right :: a) in
    _range (left - 1) (right - 1) [];;

let solve n = (List.fold_left (fun a b -> (a * b) mod 1000000007) 1 (range 1 (n + 1)));;

let () =
    let n = read_int () in
    print_int (solve n);
    print_newline ();;

