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 maxn = 1e6 + 10;
long long mod = 1e9 + 7;
long long Ans;
long long lg;
long long a[maxn];
long long b[3][maxn];
long long c[3][maxn];
long long fa[maxn], n;
void solve(int i) {
  memset(c[0], 0, sizeof c[0]);
  memset(c[1], 0, sizeof c[1]);
  long long ret = 1;
  if (i == lg) {
    for (int y = 0; y <= lg; y++) ret = (ret * b[0][y]) % mod;
    long long s = 0;
    for (int y = 0; y <= lg; y++) {
      for (int u = 1; u < b[0][y]; u++) ret = (ret * (s + u)) % mod;
      s += b[0][y];
    }
    Ans = (Ans + ret) % mod;
    return;
  }
  for (int y = 0; y < i; y++) c[0][y] = b[1][y] + b[0][y];
  for (int y = i; y <= lg; y++) {
    c[1][y] = b[1][y], c[0][i] += b[0][y];
    if (c[1][y]) ret = (ret * c[1][y]) % mod;
  }
  for (int y = 0; y <= i; y++) ret = (ret * c[0][y]) % mod;
  long long s = 0;
  for (int y = 0; y <= i; y++) {
    for (int u = 1; u < c[0][y]; u++) ret = (ret * (s + u)) % mod;
    s += c[0][y];
  }
  for (int y = i; y <= lg - 1; y++) {
    for (int u = 1; u < c[1][y]; u++) ret = (ret * (s + u)) % mod;
    s += c[1][y];
  }
  Ans = (Ans + ret) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(), cout.tie();
  cin >> n;
  for (int y = 1; y <= n; y++) a[y] = y;
  for (int y = 0; y <= 23; y++) {
    if ((1 << y) > n) {
      lg = y - 1;
      break;
    }
  }
  for (int y = 1; y <= n; y++) {
    long long p = a[y];
    int z = 0;
    while (p % 2 == 0) {
      p /= 2;
      z++;
    }
    b[0][z]++;
  }
  solve(lg);
  if ((1 << (lg - 1)) * 3 > n) return cout << Ans, 0;
  memset(b[0], 0, sizeof b[0]);
  memset(c[0], 0, sizeof c[0]);
  for (int y = 1; y <= n; y++) {
    long long p = a[y];
    int z = 0;
    while (p % 2 == 0) {
      p /= 2;
      z++;
    }
    b[(p % 3 == 0)][z]++;
  }
  for (int y = lg - 1; y >= 0; y--) solve(y);
  cout << Ans;
}
