#include using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; if (n >= MOD) { cout << 0 << endl; } else { ll x = 1; for (int i = 2; i <= n; i++) { (x *= i) %= MOD; } cout << x << endl; } return 0; }