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;
long long power(long long a, long long b) {
  long long res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long fermat_inv(long long y) { return power(y, 1000000007 - 2); }
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long dp[2][22][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int x = 0;
    long long val[22], val1[2];
    val[0] = val1[0] = 1ll;
    val1[1] = 3ll;
    for (int i = 1; i <= 21; i++) {
      val[i] = 2ll * val[i - 1];
      if (val[i] <= n) x = i;
    }
    memset(dp, 0, sizeof(dp));
    dp[0][x][0] = 1ll;
    if (val[x - 1] * 3ll <= n) dp[0][x - 1][1] = 1ll;
    for (int i = n - 2; i >= 0; i--) {
      for (int j = x; j >= 0; j--) {
        for (int k = 1; k >= 0; k--) {
          dp[(n - 1 - i) % 2][j][k] = 0ll;
          long long mul = n / (val1[k] * val[j]);
          mul -= n - i - 1;
          if (k == 0) {
            long long mul1 = n / (val1[k + 1] * val[j]) - (n - i - 1);
            dp[(n - 1 - i) % 2][j][k] +=
                (dp[(n - i) % 2][j][k + 1] * (max(0ll, mul - mul1)));
          }
          if (j < x) {
            long long mul1 = n / (val1[k] * val[j + 1]) - (n - i - 1);
            dp[(n - 1 - i) % 2][j][k] +=
                (dp[(n - i) % 2][j + 1][k] * (max(0ll, mul - mul1)));
          }
          mul = max(0ll, mul);
          dp[(n - 1 - i) % 2][j][k] += mul * dp[(n - i) % 2][j][k];
          dp[(n - 1 - i) % 2][j][k] %= 1000000007;
        }
      }
    }
    cout << dp[(n - 1) % 2][0][0] << "\n";
  }
  return 0;
}
