func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 2e6 + 10;   const long long int md = 1e9 + 7;   long long int n, fac[MAXN], invf[MAXN];   inline long long int inv(long long int a, long long int b = 1e9 + 5ll) {     long long int k = 1ll;     while (b) {       if (b & 1) k = (k * a) % md;       a = (a * a) % md;       b /= 2ll;     }     return k;   }   inline long long int ch(long long int a, long long int b) {     return ((((invf[b] * invf[a - b]) % md) * fac[a]) % md);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     fac[0] = 1ll;     invf[0] = 1ll;     cin >> n;     for (long long int i = 1ll; i < MAXN; i++)       fac[i] = (fac[i - 1] * i) % md, invf[i] = inv(fac[i]);     long long int ans = inv(2ll, 2ll * n + 1ll);     ans--;     ans = (ans + md) % md;     long long int bad = 0ll;     for (long long int i = n + 1; i <= 2ll * n; i++) {       long long int tmp = (2ll * ch(i - 1ll, n)) % md;       tmp += ((2ll * bad) % md);       tmp %= md;       ans = (((ans - tmp) % md) + md) % md;       bad = tmp;     }     cout << ans << endl;     return 0;   }   