func_code_string: #include <bits/stdc++.h>   using namespace std;   const double eps = 0.000001;   const long double pi = acos(-1);   const int maxn = 1e7 + 9;   const int mod = 1e9 + 7;   const long long MOD = 1e18 + 9;   const long long INF = 1e18 + 123;   const int inf = 2e9 + 11;   const int mxn = 1e6 + 9;   const int N = 1e6 + 123;   const int M = 22;   const int pri = 997;   const int Magic = 2101;   const int dx[] = {-1, 0, 1, 0};   const int dy[] = {0, -1, 0, 1};   int n, m, k;   int cnt[N];   string s;   int a[N];   vector<int> g[N];   int u[N];   int ans, res;   int cur;   long long fac[N];   long long bpow(long long a, long long b) {     long long res = 1;     while (b > 0) {       if (b & 1) (res *= a) %= mod;       b /= 2;       a *= a;       a %= mod;     }     return res;   }   inline void upd(long long &ans, long long l, long long r) {     ans *= fac[r];     ans %= mod;     ans = (ans * bpow(fac[l - 1], mod - 2)) % mod;   }   inline long long calc(vector<int> &pw) {     long long ans = 1, pref = 0;     vector<long long> f;     for (auto e : pw) {       f.push_back((n / e) - pref);       (ans *= f.back()) %= mod;       pref = n / e;     }     long long cur = 1;     for (int i = (int)(pw.size()) - 1; ~i; --i) {       upd(ans, cur, cur + f[i] - 2);       cur += f[i];     }     return ans;   }   int main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cin >> n;     vector<int> pw;     pw.push_back(1);     while (pw.back() * 2 <= n) {       pw.push_back(pw.back() * 2);     }     reverse(pw.begin(), pw.end());     fac[0] = 1;     for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % mod;     long long ans = calc(pw);     if (pw[0] * 3ll <= n * 2ll) {       for (int i = 1; i < (int)(pw.size()); i++) {         vector<int> o = pw;         for (int j = 0; j < i; j++) {           o[j] = 3ll * o[j] / 2ll;         }         ans += calc(o);         if (ans >= mod) ans -= mod;       }     }     cout << ans <<   n ;     return 0;   }   