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 int N = 1e6 + 1, logN = 21 + 1, mod = 1e9 + 7;
int fl(int n) {
  int ans = 0;
  while (n /= 2) ++ans;
  return ans;
}
int ord2(int n) {
  int ans = 0;
  while (n % 2 == 0) {
    n >>= 1;
    ++ans;
  }
  return ans;
}
long long binpow(long long a, long long s) {
  long long ans = 1;
  while (s) {
    if (s & 1) ans = ans * a % mod;
    a = a * a % mod;
    s >>= 1;
  }
  return ans;
}
long long inv(long long a) { return binpow(a, mod - 2); }
long long f[N], finv[N];
void init() {
  f[0] = 1;
  finv[0] = 1;
  for (long long i = 1; i < N; ++i) {
    f[i] = f[i - 1] * i % mod;
    finv[i] = inv(f[i]);
  }
}
int n, logn;
int cnt[logN];
long long solve(int k) {
  for (int i = 0; i < logn; ++i) cnt[i] = 0;
  for (int i = 1; i <= n; ++i) {
    int ord = ord2(i);
    if (ord < k)
      ++cnt[ord];
    else if (ord >= k) {
      if (i % 3)
        ++cnt[k];
      else
        ++cnt[ord + 1];
    }
  }
  long long ans = 1;
  for (int i = 0; i < logn; ++i) ans = ans * cnt[i] % mod;
  ans = ans * f[cnt[0] - 1] % mod;
  int sum = cnt[0] - 1;
  for (int i = 1; i < logn; ++i) {
    ans = ans * (f[sum + cnt[i]] * finv[sum + 1] % mod) % mod;
    sum += cnt[i];
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  init();
  cin >> n;
  logn = fl(n) + 1;
  long long ans = 0;
  for (int i = 0; i < logn; ++i) ans = (ans + solve(i)) % mod;
  cout << ans << '\n';
}
