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 nmax = 1e6 + 1;
const int mod = 1e9 + 7;
int n;
int dp[nmax][20][2];
int32_t f(int x, int y) {
  int res = (y == 1) ? 3 : 1;
  return ((int)n / (res * (1 << x))) % mod;
}
int DP(int idx, int two, int thr) {
  if (idx > n) return 1;
  if (dp[idx][two][thr] != -1) return dp[idx][two][thr];
  long long cnt = f(two, thr);
  long long res = (cnt - idx + 1 > 0)
                      ? (DP(idx + 1, two, thr) * (cnt - idx + 1 + mod)) % mod
                      : 0;
  if (two && idx != 1)
    (res +=
     (DP(idx + 1, two - 1, thr) * (f(two - 1, thr) - cnt + mod)) % mod) %= mod;
  if (thr && idx != 1)
    (res +=
     (DP(idx + 1, two, thr - 1) * (f(two, thr - 1) - cnt + mod)) % mod) %= mod;
  return dp[idx][two][thr] = res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  int raise = log2(n);
  pair<int, int> a[2];
  a[0] = make_pair(raise, 0);
  if ((1 << (raise - 1)) * 3 <= n) {
    a[1] = make_pair(raise - 1, 1);
  }
  long long res = 0;
  for (int i = (int)0; i <= (int)1; i++)
    if (a[i].first + a[i].second) {
      for (int j = (int)0; j <= (int)n; j++)
        for (int k = (int)0; k <= (int)a[i].first; k++)
          for (int h = (int)0; h <= (int)a[i].second; h++) dp[j][k][h] = -1;
      (res += DP(1, a[i].first, a[i].second)) %= mod;
    }
  cout << res;
}
