#include #define rep(i, n) for (int i = 0; i < (n); ++i) #define fi first #define se second using std::cin; using std::cout; using std::max; using std::map; using std::vector; using ll = long long; using P = std::pair; const int N = 1000005; const int mod = 1000000007; struct mint { ll x; mint(ll x=0):x((x%mod+mod)%mod){} mint operator-() const { return mint(-x);} mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res+=a; } mint operator-(const mint a) const { mint res(*this); return res-=a; } mint operator*(const mint a) const { mint res(*this); return res*=a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t>>1); a *= a; if (t&1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod-2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res/=a; } }; struct Sieve { int n; vector f, primes; Sieve(int n = 1): n(n), f(n + 1) { f[0] = f[1] = -1; for (ll i = 2; i <= n; ++i) { if (f[i]) continue; primes.push_back(i); f[i] = i; for (ll j = i * i; j <= n; j += i) { if (!f[j]) f[j] = i; } } } bool isPrime(int x) { return f[x] == x; } vector factorList(int x) { vector res; while (x != 1) { res.push_back(f[x]); x /= f[x]; } return res; } vector

factor(int x) { vector fl = factorList(x); if (fl.size() == 0) return {}; vector

res(1, P(fl[0], 0)); for (int p : fl) { if (res.back().fi == p) { res.back().se++; } else { res.emplace_back(p, 1); } } return res; } }; int main() { Sieve sieve(1e6); int n; cin >> n; map mp; for (int i = 2; i < n; ++i) { auto f = sieve.factor(i); for (auto p : f) { mp[p.fi] = max(mp[p.fi], p.se); } } mint lcm = 1; for (auto p : mp) { rep(i, p.se) { lcm *= p.fi; } } cout << lcm.x << '\n'; return 0; }