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 mod = 1e9 + 7;
int n, P2[20], P3[2], dp[2][2][1000002];
int g(int ii, int iii, int cnt) {
  if (ii + iii + cnt == 0) return 1;
  return dp[ii & 1][iii][cnt];
}
int F(int a, int b, int c) {
  for (int ii = 0; ii <= a; ii++) {
    for (int iii = 0; iii <= b; iii++) {
      for (int cnt = 0; cnt <= n; cnt++) {
        int &res = dp[ii & 1][iii][cnt];
        res = 0;
        if (cnt) {
          (res += 1LL * g(ii, iii, cnt - 1) * cnt % mod) %= mod;
        }
        if (ii) {
          int x = P3[iii] * P2[ii], c = P2[ii - 1] * P3[iii];
          int d = n / c - n / x;
          if (cnt + d - 1 <= n)
            (res += 1LL * g(ii - 1, iii, cnt + d - 1) * d % mod) %= mod;
        }
        if (iii) {
          int x = P3[iii] * P2[ii], c = P2[ii] * P3[iii - 1];
          int d = n / c - n / x;
          if (cnt + d - 1 <= n)
            (res += 1LL * g(ii, iii - 1, cnt + d - 1) * d % mod) %= mod;
        }
      }
    }
  }
  return dp[a & 1][b][c];
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<int> a;
  int mx = 0;
  P3[0] = P2[0] = 1;
  for (int i = 1; i < 20; i++) P2[i] = P2[i - 1] * 2;
  P3[1] = 3;
  for (int i = 2; i <= n; i++) {
    int c = 0, x = i;
    while (x % 2 == 0) x /= 2, ++c;
    while (x % 3 == 0) x /= 3, ++c;
    if (c > mx) a.clear();
    if (c >= mx) {
      a.push_back(i);
      mx = c;
    }
  }
  int ans = 0;
  for (int x : a) {
    int c2 = 0, c3 = 0;
    while (x % 3 == 0) x /= 3, ++c3;
    while (x % 2 == 0) x /= 2, ++c2;
    (ans += F(c2, c3, 0)) %= mod;
  }
  cout << ans << endl;
}
