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 long long MOD = 1e9 + 7;
const int SIZ2 = 22, SIZ3 = 2, N = 1e6 + 1;
long long ile[SIZ2 + 1][SIZ3 + 1];
long long dp1[SIZ2 + 1][SIZ3 + 1], dp2[SIZ2 + 1][SIZ3 + 1];
int32_t main(int argv, char** argc) {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int maxi = 0;
  for (int x = 0, pot2 = 1; x < SIZ2; x++, pot2 *= 2) {
    for (int y = 0, pot3 = 1; y < SIZ3; y++, pot3 *= 3) {
      ile[x][y] = n / (pot2 * pot3);
      if (ile[x][y] > 0) maxi = max(maxi, x + y);
    }
  }
  for (int x = 0; x < SIZ2; x++)
    for (int y = 0; y < SIZ3; y++) {
      if (ile[x][y] > 0 && x + y == maxi) dp1[x][y] = ile[x][y];
    }
  for (int i = 1; i < n; i++) {
    for (int x = SIZ2 - 1; x >= 0; x--) {
      for (int y = SIZ3 - 1; y >= 0; y--) {
        dp2[x][y] = max(0LL, dp1[x][y] * (ile[x][y] - i));
        dp2[x][y] += max(0LL, dp1[x + 1][y] * (ile[x][y] - ile[x + 1][y]));
        dp2[x][y] += max(0LL, dp1[x][y + 1] * (ile[x][y] - ile[x][y + 1]));
        dp2[x][y] %= MOD;
      }
    }
    swap(dp1, dp2);
  }
  cout << dp1[0][0];
}
