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;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const long long N = 1e6 + 1000;
const long long MOD = 1e9 + 7;
long long n;
map<pair<long long, long long>, long long> dp;
long long f(long long idx, long long prev_gcd) {
  if (idx == (n + 1)) {
    return 1;
  }
  if (dp.find(make_pair(idx, prev_gcd)) != dp.end()) {
    return dp[make_pair(idx, prev_gcd)];
  }
  long long ans = 0;
  long long present = (n / prev_gcd) - idx + 1;
  if (present > 0) {
    ans = ((present)*f(idx + 1, prev_gcd)) % MOD;
  }
  if (prev_gcd % 2 == 0) {
    ans = (ans + (f(idx + 1, prev_gcd / 2) *
                  ((n / (prev_gcd / 2)) - (n / prev_gcd))) %
                     MOD) %
          MOD;
  }
  if (prev_gcd % 3 == 0) {
    ans = (ans + (f(idx + 1, prev_gcd / 3) *
                  ((n / (prev_gcd / 3)) - (n / prev_gcd))) %
                     MOD) %
          MOD;
  }
  return (dp[make_pair(idx, prev_gcd)] = ans);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  long long temp = n;
  if (n == 2) {
    cout << 1 << "\n";
    return 0;
  }
  if (n == 3) {
    cout << 4 << "\n";
    return 0;
  }
  long long c = log2(n);
  long long d = ((((1 << c) * 3) / 2) <= n);
  long long ans = f(2, (1 << c));
  if (d > 0) {
    dp.clear();
    ans = (ans + f(2, (((1 << c) * 3) / 2))) % MOD;
  }
  cout << ans << "\n";
}
