#include using namespace std; template ostream& operator<<(ostream& out, const vector &cont) { out << "["; for(const auto &x: cont) out << x<< ", "; out << "]"; return out; } #define dmp(x) cerr << #x << " = " << x << endl #define dmpn(x) cerr << #x << " = " << x <<"; " #define ff first #define ss second #define all(x) begin(x), end(x) #define sz(x) (int) (x).size() #define int long long typedef long long ll; typedef pair pii; typedef long double ld; const int MOD = 1e9 + 7; vector facts; int mul(int x, int y) { return (x * y) % MOD; } int add(int x, int y) { return (x + y + MOD) % MOD; } int modpow(int b, int e) { int ans = 1; for (; e; b = mul(b, b), e /= 2) if (e & 1) ans = mul(ans, b); return ans; } int comb(int n, int k) { int num = facts[n]; int denom = mul(facts[n - k], facts[k]); return mul(num, modpow(denom, MOD - 2)); } void solve() { int N; cin >> N; facts.assign(4 * N + 1, 1); for (int i = 1; i <= 4 * N; i++) { facts[i] = mul(facts[i - 1], i); } int res = 0; for (int i = 1; i < N / 2 + 1; i++) { if ((i - 1) % 2 == 0) { res = add(res, mul(comb(N, i), comb(4 * N - 4 * i, 2 * N))); } else { res = add(res, -mul(comb(N, i), comb(4 * N - 4 * i, 2 * N))); } } cout << res << endl; } int32_t main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); solve(); return 0; }