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.
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300iq as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x1174E
   {
      static long MOD = 1000000007L;
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         long[][] dp = new long[20][2];
         base(dp, N);
         cnt = new long[20][2];
         for(int curr=0; (1<<curr) <= N; curr++)
            for(int b=1; b <= 3; b+=2)
            {
               int temp = (1<<curr)*b;
               cnt[curr][Math.max(b-2, 0)] = N/temp;
            }
         //iterative sad
         for(int i=2; i <= N; i++)
         {
            long[][] newdp = new long[20][2];
            for(int a=19; a >= 0; a--)
               for(int b=1; b >= 0; b--)
               {
                  long res = 0L;
                  if(cnt[a][b]-i >= 0)
                     res = (dp[a][b]*(cnt[a][b]-i+1+MOD))%MOD;
                  if(a+1 < 20)
                  {
                     res += (dp[a+1][b]*(cnt[a][b]-cnt[a+1][b]))%MOD;
                     if(res >= MOD)
                        res -= MOD;
                  }
                  if(b == 0)
                  {
                     res += (dp[a][1]*(cnt[a][0]-cnt[a][1]))%MOD;
                     if(res >= MOD)
                        res -= MOD;
                  }
                  newdp[a][b] = res;
               }
            dp = newdp;
         }
         System.out.println(dp[0][0]);
      }
      static long[][] cnt;
      public static void base(long[][] dp, int N)
      {
         int curr = 1;
         while((1<<curr) <= N)
            curr++;
         curr--;
         dp[curr][0] = 1L;
         int oth = 1<<(curr-1);
         oth *= 3;
         if(oth <= N)
            dp[curr-1][1] = 1L;
      }
   }