#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int power = 1;
  int mod = 1000000007;
  for (int i = 0; i < n; i++) power = (power * (1 + i)) % mod;
  cout << power << endl;
}
