#include<bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int mu[40005]; // mu[i] = x --> i^j với j = x;

long long POW(long long a, long long b){ // tinh (a^b) % mod
     if(b == 0) return 1;
     if(b == 1) return a;
     long long t = POW(a, b / 2);
     if(b % 2 == 0) return t * t % mod;
     return t * t % mod * a % mod;
}
int main()
{
     ios_base::sync_with_stdio(0);
     cout.tie(0); cin.tie(0);
     freopen("test.inp", "r", stdin);
     freopen("test.out", "w", stdout);
     int n; cin >> n;
     // mu[2] = 1 --> 2^1
     // khi * 4 vao 3! --> mu[2] = 3
     // 4! = 2 * 3 * 4 = 2^3 * 3^1 --> mu[2] = 3; mu[3] = 1
     // 5! --> mu[2] = 3; mu[3] = 1; mu[5] = 1
     for(int num = 2; num <= n; num++){
          int temp = num;
          for(int i = 2; i * i <= temp; i++){
               while(temp % i == 0){
                    mu[i]++;
                    temp /= i;
               }
          }
          if(temp != 1) mu[temp]++;
     }

     long long res = 1;
     for(int num = 2; num <= n; num++){
          bool ok = true;
          for(int i = 2; i * i <= num; i++){
               if(num % i == 0){
                    ok = false;
                    break;
               }
          }

          if(ok){
               if(mu[num] % 2 == 1){
                    mu[num]--;
               }
               res = (res * POW(num, mu[num])) % mod;
//               cout << num << " " << mu[num] << '\n';
          }
     }
     cout << res;

}









