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;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 62;
const int mods = 1e9 + 7;
const int MAXN = 1000005;
const int INF = 0x3f3f3f3f;
inline int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
int a[45], g[45], f[MAXN][45], id[MAXN];
int upd(int x, int y) { return x + y >= mods ? x + y - mods : x + y; }
signed main() {
  int n = read(), m, flag = 0;
  if (n == 2) {
    puts("1");
    return 0;
  }
  for (m = 0; 1 << m <= n; m++) a[m] = 1 << m;
  m--;
  if (a[m] * 3 / 2 <= n) {
    flag = 1;
    for (int i = 0; i < m; i++) a[m + i + 1] = a[i] * 3;
    m = m + m;
  }
  sort(a, a + m + 1, [&](int x, int y) { return x > y; });
  for (int i = 0; i <= m; i++) id[a[i]] = i;
  for (int i = 0; i <= m; i++) g[i] = n / a[i];
  f[1][0] = 1;
  if (flag) f[1][1] = 1;
  for (int i = 1; i < n; i++)
    for (int j = 0; j < m; j++) {
      f[i + 1][j] = upd(f[i + 1][j], 1ll * f[i][j] * max(g[j] - i, 0) % mods);
      if (a[j] % 2 == 0)
        f[i + 1][id[a[j] / 2]] =
            upd(f[i + 1][id[a[j] / 2]],
                1ll * f[i][j] * max(g[id[a[j] / 2]] - g[j], 0) % mods);
      if (a[j] % 3 == 0)
        f[i + 1][id[a[j] / 3]] =
            upd(f[i + 1][id[a[j] / 3]],
                1ll * f[i][j] * max(g[id[a[j] / 3]] - g[j], 0) % mods);
    }
  int ans = 0;
  for (int i = n, fac = 1; i >= 1; i--)
    ans = upd(ans, 1ll * fac * f[i][m] % mods),
    fac = 1ll * fac * (n - i + 1) % mods;
  printf("%d\n", ans);
  return 0;
}
