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;
long long n, m, k, x, y, z;
long long b[300500], c[300500];
long long a[300500];
long long Abs(long long x) { return (x > 0 ? x : -x); }
vector<long long> g[25];
long long fac[1005000], invfac[1000500];
long long binpow(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long tmp = binpow(x, y / 2);
  tmp = tmp * tmp % 1000000007;
  if (y % 2) {
    return x * tmp % 1000000007;
  }
  return tmp;
}
long long prod(long long l, long long r) {
  if (l > r) {
    return 1;
  }
  return fac[r] * invfac[l - 1] % 1000000007;
}
int main() {
  fac[0] = invfac[0] = 1;
  for (int i = 1; i <= 1000001; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    invfac[i] = binpow(fac[i], 1000000007 - 2);
  }
  cin >> n;
  long long x = 1;
  while (x * 2 <= n) {
    x *= 2;
    k++;
  }
  long long px = x;
  while (px > 1) {
    g[0].push_back(px);
    px /= 2;
  }
  g[0].push_back(1);
  long long sz = 1;
  if (x / 2 * 3 <= n) {
    for (int i = 1; i <= k; i++) {
      long long xx = x / 2 * 3;
      g[i].push_back(xx);
      for (int j = 1; j <= k; j++) {
        if (i == j) {
          xx /= 3;
        } else {
          xx /= 2;
        }
        g[i].push_back(xx);
      }
    }
    sz = k + 1;
  }
  long long ans = 0;
  for (int i = 0; i < sz; i++) {
    long long used = 0;
    long long tmp = 1;
    for (auto x : g[i]) {
      long long k = n / x - used;
      tmp = tmp * prod(n - used - k + 1, n - used - 1) % 1000000007 * k %
            1000000007;
      used += k;
    }
    ans += tmp;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
