#include "bits/stdc++.h"
using namespace std;
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define DIVUP(x, y) (((x) + ((y) - 1)) / (y))
#define DIVOFF(x, y) (((x) + ((y) / 2)) / (y))
#define REMAINDER(x, y) ((x) % (y))
int N;
long ans{1};
int main() {
  scanf("%d", &N);
  for (int i{1}; i <= N; ++i) {
    ans *= i;
    ans %= 1000000007;
  }
  printf("%ld\n", ans);
  return 0;
}
