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.
import java.io.*;
import java.util.*;

public class CF1174E {
	static final int MD = 1000000007;
	static long[] ff, gg;
	static long power(long a, long k) {
		if (k == 0)
			return 1;
		long p = power(a, k / 2);
		p = p * p % MD;
		if (k % 2 == 1)
			p = p * a % MD;
		return p;
	}
	static void init(int n) {
		ff = new long[n + 1];
		gg = new long[n + 1];
		long f = 1;
		for (int i = 0; i <= n; i++) {
			ff[i] = f;
			gg[i] = power(f, MD - 2);
			f = f * (i + 1) % MD;
		}
	}
	static long ch(int n, int k) {
		return ff[n] * gg[n - k] % MD * gg[k] % MD;
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		init(n);
		int[] aa = new int[n + 1];
		for (int i = 1; i <= n; i++)
			aa[i] = i % 2 == 0 ? aa[i / 2] + 1 : 0;
		int k = 0;
		while (1 << k + 1 <= n)
			k++;
		int[] cnt = new int[k + 1];
		int[] cnt3 = new int[k + 1];
		for (int i = 1; i <= n; i++) {
			int a = aa[i];
			cnt[a]++;
			if (i % 3 == 0)
				cnt3[a]++;
		}
		int[] sum = new int[k + 1];
		int[] sum3 = new int[k + 1];
		for (int i = 0; i <= k; i++) {
			sum[i] = (i == 0 ? 0 : sum[i - 1]) + cnt[i];
			sum3[i] = (i == 0 ? 0 : sum3[i - 1]) + cnt3[i];
		}
		long[] dp = new long[k + 1];
		long[] dp3 = new long[k + 1];
		int s, a, b;
		a = cnt[0];
		dp[0] = ff[a];
		for (int i = 1; i <= k; i++) {
			a = cnt[i];
			if (a == 0)
				continue;
			s = sum[i - 1];
			dp[i] = dp[i - 1] * ch(s + a - 1, a - 1) % MD * ff[a] % MD;
		}
		a = cnt3[0];
		b = sum[k] - sum3[k];
		dp3[0] = a == 0 ? 0 : ff[b] * ch(b + a - 1, a - 1) % MD * ff[a] % MD;
		for (int i = 1; i <= k; i++) {
			a = cnt3[i];
			if (a == 0)
				continue;
			s = sum3[i - 1] + sum[k] - sum3[k];
			dp3[i] = dp3[i - 1] * ch(s + a - 1, a - 1) % MD * ff[a] % MD;
			b = (sum[k] - sum3[k]) - (sum[i - 1] - sum3[i - 1]);
			if (b == 0)
				continue;
			s = sum[i - 1];
			dp3[i] = (dp3[i] + dp[i - 1] * ch(s + b - 1, b - 1) % MD * ff[b] % MD
				* ch(s + b + a - 1, a - 1) % MD * ff[a]) % MD;
		}
		System.out.println((dp[k] + (3 << k - 1 <= n ? dp3[k - 1] : 0)) % MD);
	}
}
