#include<bits/stdc++.h> #define MOD 9999991 usingnamespace std; typedeflonglong lnt; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } int n; lnt ans = 1; intmain(){ read(n); for (int i = 1; i <= n-2; i++) (ans *= 1LL*n) %= MOD; for (int i = 1; i <= n-1; i++) (ans *= 1LL*i) %= MOD; returnprintf("%lld\n", ans), 0; }