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 double PI = acos(-1.0);
const int mod = 1000000007;
const int mask = 1;
const int maxp = 30;
long long dp[2][22][3];
long long p2[maxp];
long long p3[maxp];
long long zz[maxp][maxp];
int zml(int a2, int a3, int n) {
  memset(dp, 0, sizeof(dp));
  for (int j = 0; j < maxp; j++)
    for (int k = 0; k < maxp; k++) {
      zz[j][k] = n / (p2[j] * p3[k]);
    }
  dp[0][a2][a3] = zz[a2][a3];
  for (int i = 1; i < n; i++) {
    for (int j = 0; j <= a2; j++)
      for (int k = 0; k <= a3; k++) {
        dp[i & mask][j][k] = 0;
        long long &z0 = zz[j][k];
        long long &z1 = zz[j + 1][k];
        long long &z2 = zz[j][k + 1];
        if (z0 <= i) continue;
        dp[i & mask][j][k] += dp[(i - 1) & mask][j][k] * max(z0 - i, 0LL);
        dp[i & mask][j][k] += dp[(i - 1) & mask][j + 1][k] * (z0 - z1);
        dp[i & mask][j][k] += dp[(i - 1) & mask][j][k + 1] * (z0 - z2);
        dp[i & mask][j][k] %= mod;
      }
  }
  return dp[(n - 1) & mask][0][0];
}
void getfac() {
  p2[0] = p3[0] = 1;
  for (int i = 1; i < maxp; i++) {
    p2[i] = p2[i - 1] * 2;
    p3[i] = p3[i - 1] * 3;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  getfac();
  int n;
  cin >> n;
  int a2;
  for (a2 = 0; p2[a2] <= n; a2++)
    ;
  a2--;
  long long ans = 0;
  ans += zml(a2, 0, n);
  if (p2[a2 - 1] * 3 <= n) ans += zml(a2 - 1, 1, n);
  ans %= mod;
  cout << ans << endl;
  return 0;
}
