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 = 1000000 + 5;
const int MaxB = 20 + 2;
const int inf = 1000000000 + 7;
int n, m = 0;
long long sum[MaxB][2];
int cnt[4][MaxB];
int calc(int num) {
  int res = 0;
  while (num % 2 == 0) {
    ++res;
    num /= 2;
  }
  return res;
}
long long solve() { return sum[0][0]; }
int main() {
  scanf("%d", &n);
  memset(cnt, 0, sizeof cnt);
  for (int k = 1; k <= n; ++k) {
    int tmp = calc(k);
    m = max(m, tmp);
    ++cnt[0][tmp];
    if (k % 3 == 0)
      ++cnt[1][tmp];
    else {
      ++cnt[2][tmp];
      while (tmp--) ++cnt[2][tmp];
    }
  }
  memset(sum, 0, sizeof sum);
  sum[m][0] = 1;
  sum[m][1] = cnt[1][m - 1];
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j <= m; ++j) {
      sum[j][0] = sum[j][0] * (n / (1 << j) - i) % inf +
                  sum[j + 1][0] * cnt[0][j] % inf +
                  sum[j + 1][1] * cnt[2][j] % inf;
      sum[j][0] %= inf;
      if (j == 0) continue;
      sum[j][1] = sum[j][1] * (n / (3 << (j - 1)) - i) % inf +
                  sum[j + 1][1] * cnt[1][j - 1] % inf;
      sum[j][1] %= inf;
    }
  }
  cout << sum[0][0] << endl;
  return 0;
}
