#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;
}
