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 + 10;
const long long MOD = 1e9 + 7;
long long fac[N], inv[N];
int n, cnt[50];
long long a[50][2], p[50][2];
long long pre[50], suf[50];
int main() {
  inv[1] = 1;
  for (int i = 2; i < N; i++) inv[i] = (MOD - (MOD / i)) * inv[MOD % i] % MOD;
  fac[0] = 1;
  for (int i = 1; i < N; i++) fac[i] = fac[i - 1] * i % MOD;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int t = i, c = 0;
    while (t % 2 == 0) {
      t /= 2, c++;
    }
    cnt[c]++;
  }
  int mx = 0;
  for (int i = 49; i >= 0; i--) {
    if (cnt[i]) {
      mx = i;
      break;
    }
  }
  long long ans = 0;
  long long sum = n, tmp = fac[n];
  for (int i = mx; i >= 0; i--) {
    tmp = tmp * cnt[i] % MOD * inv[sum] % MOD;
    sum -= cnt[i];
  }
  ans = tmp;
  for (int i = 1; i <= n; i++) {
    int t = i, c = 0;
    while (t % 2 == 0) {
      t /= 2, c++;
    }
    c = min(c, mx - 1);
    if (i % 3 == 0)
      a[c][1]++;
    else
      a[c][0]++;
  }
  for (int i = mx - 1; i >= 0; i--) {
    long long tmp = 1, sum = n;
    for (int j = mx - 1; j >= i; j--) {
      tmp = tmp * a[j][1] % MOD * inv[sum] % MOD;
      sum -= a[j][1];
    }
    long long tmpsum = 0;
    for (int j = i; j < mx; j++) tmpsum += a[j][0];
    tmp = tmp * tmpsum % MOD * inv[sum] % MOD;
    sum -= tmpsum;
    for (int j = i - 1; j >= 0; j--) {
      tmp = tmp * (a[j][0] + a[j][1]) % MOD * inv[sum] % MOD;
      sum -= (a[j][0] + a[j][1]);
    }
    ans = (ans + tmp * fac[n] % MOD) % MOD;
  }
  cout << ans << endl;
}
