Let's define a function f(p) on a permutation p as follows. Let g_i be the [greatest common divisor (GCD)](https://en.wikipedia.org/wiki/Greatest_common_divisor) of elements p_1, p_2, ..., p_i (in other words, it is the GCD of the prefix of length i). Then f(p) is the number of distinct elements among g_1, g_2, ..., g_n.

Let f_{max}(n) be the maximum value of f(p) among all permutations p of integers 1, 2, ..., n.

Given an integers n, count the number of permutations p of integers 1, 2, ..., n, such that f(p) is equal to f_{max}(n). Since the answer may be large, print the remainder of its division by 1000 000 007 = 10^9 + 7.

Input

The only line contains the integer n (2 ≤ n ≤ 10^6) — the length of the permutations.

Output

The only line should contain your answer modulo 10^9+7.

Examples

Input


2


Output


1

Input


3


Output


4

Input


6


Output


120

Note

Consider the second example: these are the permutations of length 3:

  * [1,2,3], f(p)=1. 
  * [1,3,2], f(p)=1. 
  * [2,1,3], f(p)=2. 
  * [2,3,1], f(p)=2. 
  * [3,1,2], f(p)=2. 
  * [3,2,1], f(p)=2. 



The maximum value f_{max}(3) = 2, and there are 4 permutations p such that f(p)=2.
#include <bits/stdc++.h>
using namespace std;
const long long somod = 1e9 + 7;
const long long maxn = 1e6 + 7;
long long dem[30][2], n, dp[2][21][2], cst2[30][2], cst3[30][2];
vector<long long> cnt(4, 0);
void Add(long long &a, long long b) { a = (a + b) % somod; }
long long mul(long long a, long long b) { return a * b % somod; }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (fopen("test.inp", "r"))
    freopen("test.inp", "r", stdin), freopen("test.out", "w", stdout);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    long long cnt[4], val = i;
    cnt[2] = cnt[3] = 0;
    for (long long j = 2; j <= 3; j++)
      while (val % j == 0) val /= j, cnt[j]++;
    cnt[3] = min(cnt[3], 1ll);
    dem[cnt[2]][cnt[3]]++;
  }
  for (long long i = 1; i >= 0; i--) {
    long long sum = 0;
    for (long long j = 20; j >= 0; j--) {
      Add(sum, dem[j][i]);
      cst3[j][i] = sum;
    }
  }
  for (long long i = 20; i >= 0; i--) {
    long long sum = 0;
    for (long long j = 1; j >= 0; j--) {
      Add(sum, dem[i][j]);
      cst2[i][j] = sum;
    }
  }
  for (long long i = 20; i >= 0; i--) {
    for (long long j = 1; j >= 0; j--) {
      if (j == 1)
        dem[i][j] += dem[i + 1][j];
      else
        dem[i][j] += dem[i + 1][j] + dem[i][j + 1] - dem[i + 1][j + 1];
    }
  }
  long long gau = 1;
  while (gau <= n) gau *= 2, cnt[2]++;
  gau /= 2, cnt[2]--, dp[1][cnt[2]][0]++;
  if (cnt[2] > 0 && gau / 2 * 3 <= n) dp[1][cnt[2] - 1][1]++, cnt[3]++;
  for (long long i = 2; i <= n; i++) {
    long long cur = i & 1;
    long long prv = 1 - cur;
    for (long long j = 0; j <= cnt[2]; j++) {
      for (long long k = 0; k <= cnt[3]; k++) {
        dp[cur][j][k] = 0;
        if (dem[j][k] >= i)
          Add(dp[cur][j][k], mul(dp[prv][j][k], dem[j][k] - i + 1));
        if (j < cnt[2]) Add(dp[cur][j][k], mul(dp[prv][j + 1][k], cst2[j][k]));
        if (k < cnt[3]) Add(dp[cur][j][k], mul(dp[prv][j][k + 1], cst3[j][k]));
      }
    }
  }
  cout << dp[n & 1][0][0];
}
