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;
char getc() {
  char c = getchar();
  while ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') && (c < '0' || c > '9'))
    c = getchar();
  return c;
}
int gcd(int n, int m) { return m == 0 ? n : gcd(m, n % m); }
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return x * f;
}
int n, ans, a[30], fac[1000010], inv[1000010], b[2][30];
int C(int n, int m) {
  if (m > n) return 0;
  return 1ll * fac[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;
}
void inc(int &x, int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
signed main() {
  n = read();
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % 1000000007;
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] =
        1000000007 - 1ll * (1000000007 / i) * inv[1000000007 % i] % 1000000007;
  for (int i = 2; i <= n; i++) inv[i] = 1ll * inv[i] * inv[i - 1] % 1000000007;
  int m = 0, tmp = n;
  while (tmp) m++, tmp >>= 1;
  m--;
  if ((3 << m - 1) <= n) {
    for (int i = 1; i <= n; i++) {
      int x = 0, y = i;
      while (y % 2 == 0) y >>= 1, x++;
      if (i % 3 == 0)
        b[1][min(x, m - 1)]++;
      else
        b[0][min(x, m - 1)]++;
    }
    for (int i = m - 1; i >= 0; i--) {
      int s = 1, u = n;
      for (int j = m - 1; j >= i; j--) {
        s = 1ll * s * C(u - 1, b[1][j] - 1) % 1000000007 * fac[b[1][j]] %
            1000000007;
        u -= b[1][j];
      }
      int tot = 0;
      for (int j = m - 1; j >= i; j--) tot += b[0][j];
      s = 1ll * s * C(u - 1, tot - 1) % 1000000007 * fac[tot] % 1000000007;
      u -= tot;
      for (int j = i - 1; j >= 0; j--) {
        s = 1ll * s * C(u - 1, b[0][j] + b[1][j] - 1) % 1000000007 *
            fac[b[0][j] + b[1][j]] % 1000000007;
        u -= b[0][j] + b[1][j];
      }
      inc(ans, s);
    }
  }
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= n; i++) {
    int x = 0, y = i;
    while (y % 2 == 0) y >>= 1, x++;
    a[x]++;
  }
  int s = 1, u = n;
  for (int i = m; i >= 0; i--) {
    s = 1ll * s * C(u - 1, a[i] - 1) % 1000000007 * fac[a[i]] % 1000000007;
    u -= a[i];
  }
  inc(ans, s);
  cout << ans;
  return 0;
}
