Problem:
Score : 200 points

Problem Statement

Snuke loves working out. He is now exercising N times.

Before he starts exercising, his power is 1. After he exercises for the i-th time, his power gets multiplied by i.

Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Constraints

1 ≤ N ≤ 10^{5}

Input

The input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^{9}+7.

Sample Input 1

3

Sample Output 1

6

After Snuke exercises for the first time, his power gets multiplied by 1 and becomes 1.

After Snuke exercises for the second time, his power gets multiplied by 2 and becomes 2.

After Snuke exercises for the third time, his power gets multiplied by 3 and becomes 6.

Sample Input 2

10

Sample Output 2

3628800

Sample Input 3

100000

Sample Output 3

457992974

Print the answer modulo 10^{9}+7.

Solution in Rust (1.15.1) (judge verdict: Accepted)

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize
    }
    let mut res = 1;
    for i in 1..n + 1 {
        res = (res * i) % 1000000007;
    }
    println!("{}", res);
}

// fn main() {
//     input! {
//         h: usize,
//         w: usize,
//         s: [chars; h]
//     }
//     let xy = [
//         // [-1i32, 1i32],
//         [0i32, 1i32],
//         // [1i32, 1i32],
//         [-1i32, 0i32],
//         [1i32, 0i32],
//         // [-1i32, -1i32],
//         [0i32, -1i32],
//         // [1i32, -1i32],
//     ];
//     let mut s = s;
//     for y in 0..h {
//         for x in 0..w {
//             if s[y][x] == '.' {
//                 continue;
//             }
//             let mut b = false;
//             for i in 0..4 {
//                 let xx = x as i32 + xy[i][0] as i32;
//                 let yy = y as i32 + xy[i][1] as i32;
//                 if xx < 0 || w as i32 <= xx {
//                     continue;
//                 }
//                 if yy < 0 || h as i32 <= yy {
//                     continue;
//                 }
//                 if s[yy as usize][xx as usize] == '#' {
//                     b = true;
//                 }
//             }
//             if !b {
//                 println!("No");
//                 return;
//             }
//         }
//     }
//     println!("Yes")
// }