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 = 1000000 + 1;
const long long MOD = 1000000000 + 7;
vector<pair<int, int> > factorization[N];
int tot[N];
int n;
long long factorial[N];
map<int, long long> dp[N];
void init() {
  for (int i = 2; i < N; ++i) {
    if (factorization[i].empty()) {
      for (int j = i; j < N; j += i) {
        int num = j;
        int cnt = 0;
        while (num % i == 0) {
          tot[j]++;
          cnt++;
          num /= i;
        }
        factorization[j].push_back({i, cnt});
      }
    }
  }
  factorial[0] = 1;
  for (int i = 1; i < N; ++i) factorial[i] = i * factorial[i - 1] % MOD;
}
long long solve(int num, int taken, int rem) {
  if (tot[num] == 0) return factorial[rem];
  auto it = dp[num].find(taken);
  if (it != dp[num].end()) return it->second;
  long long &ret = dp[num][taken];
  if (n / num - taken > 0)
    ret = (ret + solve(num, taken + 1, rem - 1) * (n / num - taken)) % MOD;
  for (pair<int, int> p : factorization[num]) {
    int nxtNum = num / p.first;
    ret = (ret + solve(nxtNum, taken + 1, rem - 1) * (n / nxtNum - (n / num))) %
          MOD;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  init();
  cin >> n;
  int maxi = *max_element(tot, tot + n + 1);
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    if (tot[i] == maxi) ans = (ans + solve(i, 1, n - 1)) % MOD;
  cout << ans << endl;
}
