#include #include #include #include #include #define REP(i, n) for (ll i = 0; i < n; i++) #define REP1(i, n) for (ll i = 1; i <= n; i++) #define RREP(i, n) for (ll i = n - 1; i >= 0; i--) #define RREP1(i, n) for (ll i = n; i >= 1; i--) #define FOR(i, a, b, c) for (ll i = a; i <= b; i += c) #define RFOR(i, a, b, c) for (ll i = a; i >= b; i -= c) #define MAX(a, b) (a > b ? a : b) #define MIN(a, b) (a < b ? a : b) #define INF 1145141919 typedef long long ll; typedef unsigned long long ull; #define MOD 1000000007 ull modfact(ull n) { ull a = 1; REP1(i, n) { a *= i % MOD; a %= MOD; } return a; } int main() { ull n, ans; scanf("%llu", &n); if (n >= 1000000009) ans = 0; else ans = modfact(n); printf("%llu\n", ans); return 0; }