#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
const int md = 1e8 + 7;
auto mul = [&](int a, int b) {
return (long long) a * b % md;
};
auto power = [&](int a, int e) {
int ret = 1;
for (; e; e >>= 1) {
if (e & 1) {
ret = mul(ret, a);
}
a = mul(a, a);
}
return ret;
};
vector<bool> p(n + 1, true);
int ans = 1;
for (int i = 2; i <= n; i++) {
if (!p[i]) {
continue;
}
int cnt = 0;
for (long long ipow = i; ipow <= n; ipow *= i) {
cnt += n / ipow;
}
if (cnt & 1) {
cnt--;
}
ans = mul(ans, power(i, cnt));
if ((long long) i * i > n) {
continue;
}
for (int j = i * i; j <= n; j += i) {
p[j] = false;
}
}
cout << ans << '\n';
cerr << "Time: " << double(clock()) / CLOCKS_PER_SEC << '\n';
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgaW50IG47CiAgY2luID4+IG47CiAgY29uc3QgaW50IG1kID0gMWU4ICsgNzsKICBhdXRvIG11bCA9IFsmXShpbnQgYSwgaW50IGIpIHsKICAgIHJldHVybiAobG9uZyBsb25nKSBhICogYiAlIG1kOwogIH07CiAgYXV0byBwb3dlciA9IFsmXShpbnQgYSwgaW50IGUpIHsKICAgIGludCByZXQgPSAxOwogICAgZm9yICg7IGU7IGUgPj49IDEpIHsKICAgICAgaWYgKGUgJiAxKSB7CiAgICAgICAgcmV0ID0gbXVsKHJldCwgYSk7CiAgICAgIH0KICAgICAgYSA9IG11bChhLCBhKTsKICAgIH0KICAgIHJldHVybiByZXQ7CiAgfTsKICB2ZWN0b3I8Ym9vbD4gcChuICsgMSwgdHJ1ZSk7CiAgaW50IGFucyA9IDE7CiAgZm9yIChpbnQgaSA9IDI7IGkgPD0gbjsgaSsrKSB7CiAgICBpZiAoIXBbaV0pIHsKICAgICAgY29udGludWU7CiAgICB9CiAgICBpbnQgY250ID0gMDsKICAgIGZvciAobG9uZyBsb25nIGlwb3cgPSBpOyBpcG93IDw9IG47IGlwb3cgKj0gaSkgewogICAgICBjbnQgKz0gbiAvIGlwb3c7CiAgICB9CiAgICBpZiAoY250ICYgMSkgewogICAgICBjbnQtLTsKICAgIH0KICAgIGFucyA9IG11bChhbnMsIHBvd2VyKGksIGNudCkpOwogICAgaWYgKChsb25nIGxvbmcpIGkgKiBpID4gbikgewogICAgICBjb250aW51ZTsKICAgIH0KICAgIGZvciAoaW50IGogPSBpICogaTsgaiA8PSBuOyBqICs9IGkpIHsKICAgICAgcFtqXSA9IGZhbHNlOwogICAgfQogIH0KICBjb3V0IDw8IGFucyA8PCAnXG4nOwogIGNlcnIgPDwgIlRpbWU6ICIgPDwgZG91YmxlKGNsb2NrKCkpIC8gQ0xPQ0tTX1BFUl9TRUMgPDwgJ1xuJzsKICByZXR1cm4gMDsKfQo=