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 main() {
  const int64_t mod = 1000000007;
  auto sub = [&](int64_t a, int64_t b) { return a < b ? a - b + mod : a - b; };
  auto add = [&](int64_t a, int64_t b) { return sub(a, mod - b); };
  auto mul = [&](int64_t a, int64_t b) { return a * b % mod; };
  int n, k = 0;
  cin >> n;
  for (int m = n >> 1; m; m >>= 1) ++k;
  if (n & 1 << (k - 1)) {
    cerr << "if" << endl;
    vector<int> num(k + k + 1), cnt(k + k + 1);
    vector<vector<int>> son(k + k + 1);
    for (int i = 0; i <= k; ++i) {
      num.at(i + i) = 1 << i;
      if (i != k) {
        num.at(i + i + 1) = (1 << i) * 3;
        son.at(i + i).emplace_back(i + i + 1);
        son.at(i + i).emplace_back(i + i + 2);
      }
      if (i < k - 1) son.at(i + i + 1).emplace_back(i + i + 3);
    }
    for (int i = 0; i <= k + k; ++i) cnt.at(i) = n / num.at(i);
    vector<int64_t> dp0(k + k + 1), dp1(k + k + 1);
    dp0.at(k + k) = 1;
    dp0.at(k + k - 1) = 1;
    for (int i = 1; i != n; ++i) {
      fill(dp1.begin(), dp1.end(), 0);
      for (int j = 0; j <= k + k; ++j)
        if (i < cnt.at(j)) {
          dp1.at(j) = mul(dp0.at(j), cnt.at(j) - i);
          for (const auto& s : son.at(j))
            dp1.at(j) = add(dp1.at(j), mul(dp0.at(s), cnt.at(j) - cnt.at(s)));
        }
      swap(dp0, dp1);
    }
    cout << dp0.front() << endl;
  } else {
    vector<int> num(k + 1), cnt(k + 1);
    vector<vector<int>> son(k + 1);
    for (int i = 0; i <= k; ++i) {
      num.at(i) = 1 << i;
      if (i != k) son.at(i).emplace_back(i + 1);
      cnt.at(i) = n / num.at(i);
    }
    vector<int64_t> dp0(k + 1), dp1(k + 1);
    dp0.back() = 1;
    for (int i = 1; i != n; ++i) {
      fill(dp1.begin(), dp1.end(), 0);
      for (int j = 0; j <= k; ++j)
        if (i < cnt.at(j)) {
          dp1.at(j) = mul(dp0.at(j), cnt.at(j) - i);
          for (const auto& s : son.at(j))
            dp1.at(j) = add(dp1.at(j), mul(dp0.at(s), cnt.at(j) - cnt.at(s)));
        }
      swap(dp0, dp1);
    }
    cout << dp0.front() << endl;
  }
}
