#include using namespace std; typedef long long int ll; const ll MOD = 1000000007; ll n, ans = 1; int main() { cin >> n; if (n >= MOD)cout << 0 << endl; else { for (int i = 1; i <= n; i++)ans = (ans*i) % MOD; cout << ans << endl; } return 0; }