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 power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int ct[1000010];
int r;
int f[1000010];
int g[1000010];
int C(int n, int m) {
  if (m > n) return 0;
  int vv = 1LL * g[n - m] * g[m] % 1000000007;
  vv = 1LL * vv * f[n] % 1000000007;
  return vv;
}
int calc() {
  int ans = 1;
  for (int i = 0; i <= r; i++) ans = 1LL * ans * f[ct[i]] % 1000000007;
  int cnt = ct[0];
  for (int i = 1; i <= r; i++) {
    int add = C(cnt + ct[i], ct[i]) - C(cnt + ct[i] - 1, ct[i]);
    if (add >= 1000000007) add -= 1000000007;
    if (add < 0) add += 1000000007;
    ans = 1LL * ans * add % 1000000007;
    cnt += ct[i];
  }
  return ans;
}
int main() {
  f[0] = 1;
  for (int i = 1; i < 1000010; i++) f[i] = 1LL * f[i - 1] * i % 1000000007;
  g[1000010 - 1] = power(f[1000010 - 1], 1000000007 - 2, 1000000007);
  for (int i = 1000010 - 2; i >= 0; i--)
    g[i] = 1LL * g[i + 1] * (i + 1) % 1000000007;
  int n;
  scanf("%d", &n);
  int st = 1;
  r = 0;
  while (st <= n) {
    r++;
    st *= 2;
  }
  r--;
  st = 1;
  ct[r] = 1;
  for (int i = 0; i < r; i++) {
    ct[i] = n / st - (n / (st * 2));
    st *= 2;
  }
  int ans = 0;
  ans += calc();
  if (ans >= 1000000007) ans -= 1000000007;
  int v = 3 * (1 << (r - 1));
  if (v <= n) {
    for (int i = 1; i <= r; i++) {
      ct[r] = 1;
      int val = v;
      for (int j = 1; j <= r; j++) {
        int f;
        if (j == i)
          f = 3;
        else
          f = 2;
        val /= f;
        ct[r - j] = (n / val) - (n / (val * f));
      }
      ans += calc();
      if (ans >= 1000000007) ans -= 1000000007;
    }
  }
  printf("%d\n", ans);
  return 0;
}
