#include<iostream>
#include<math.h>
using namespace std;
const int MOD = 1e9+7;
int power(int n)
{
    if(n == 0)
        return 1;
    return (1ll*(power(n-1)%MOD)*n)%MOD;
}
int main()
{
    int n;
    cin >> n;
    cout << power(n);
}
