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;
int readint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int cys = 1000000007;
int n;
long long d[1000005], f[1000005], fac[1000005], inv[1000005];
long long qpow(long long x, long long p) {
  long long ret = 1;
  for (; p; p >>= 1, x = x * x % cys)
    if (p & 1) ret = ret * x % cys;
  return ret;
}
int mod(int x) { return x >= cys ? x - cys : x; }
int main() {
  n = readint();
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % cys;
  inv[n] = qpow(fac[n], cys - 2);
  for (int i = n - 1; i >= 1; i--) inv[i] = inv[i + 1] * (i + 1) % cys;
  for (int i = n; i >= 1; i--) {
    if (2 * i > n) d[i] = f[i] = 1;
    for (int j = i + i; j <= min(3 * i, n); j += i) {
      if (d[j] + 1 > d[i]) d[i] = d[j] + 1, f[i] = 0;
      if (d[j] + 1 == d[i])
        f[i] = mod(f[i] + f[j] * fac[n / i - n / j] % cys * fac[n - n / j - 1] %
                              cys * inv[n / i - n / j - 1] % cys *
                              inv[n - n / i] % cys);
    }
  }
  cout << f[1] << endl;
  return 0;
}
