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 n;
int ok[1000005];
int b[1000005];
long long RR;
int memo[1000001][20][2];
int last = 1;
long long mod = 1e9 + 7;
long long F3[20];
long long F2[20];
int solve(int i, int j, int k) {
  if (i == n) {
    return j == 0 && k == 0;
  }
  int &ret = memo[i][j][k];
  if (ret != -1) return ret;
  ret = 0;
  long long temp = 0;
  if (k > 0) {
    long long p = F2[j] * F3[k];
    long long p2 = F2[j] * F3[k - 1];
    long long have = n / p2;
    have -= n / p;
    if (have > 0) temp += 1LL * have * solve(i + 1, j, k - 1);
    temp %= mod;
  }
  if (j > 0) {
    long long p = F2[j] * F3[k];
    long long p2 = F2[j - 1] * F3[k];
    long long have = n / p2;
    have -= n / p;
    if (have > 0) temp += 1LL * have * solve(i + 1, j - 1, k);
    temp %= mod;
  }
  long long p = F2[j] * F3[k];
  long long rem = n / p - i;
  if (rem > 0) temp += 1LL * rem * solve(i + 1, j, k);
  temp %= mod;
  ret = temp;
  return ret;
}
int main() {
  F2[0] = 1;
  F3[0] = 1;
  for (int i = 1; i < 20; i++) {
    F2[i] = F2[i - 1] * 2;
    F3[i] = F3[i - 1] * 3;
  }
  memset(memo, -1, sizeof(memo));
  cin >> n;
  int maxx = 0;
  for (int i = 2; i <= n; i++) {
    long long x = i;
    int cnt = 0;
    while (x % 2 == 0) {
      cnt++;
      x = x / 2;
    }
    while (x % 3 == 0) {
      cnt++;
      x = x / 3;
    }
    maxx = max(maxx, cnt);
    b[i] = cnt;
  }
  long long ans = 0;
  for (int i = 2; i <= n; i++) {
    if (b[i] == maxx) {
      last++;
      int R2 = 0;
      int R3 = 0;
      int temp = i;
      while (temp % 2 == 0) {
        temp = temp / 2;
        R2++;
      }
      while (temp % 3 == 0) {
        temp = temp / 3;
        R3++;
      }
      ans += solve(1, R2, R3);
      ans %= mod;
    }
  }
  cout << ans << endl;
}
