#include using namespace std; const int mod = 1e9 + 7; const int MAX_N = 500000; const int MAX_N2 = MAX_N * 2 + 1; int64_t fact[MAX_N2]; int64_t revFact[MAX_N2]; int64_t invMod[MAX_N2]; int64_t powMod(int64_t x, int64_t y) { int64_t r = 1, a = x % mod; while (y) { if (y & 1) r = (r * a) % mod; a = a * a % mod; y /= 2; } return r; } void setup(int n) { fact[0] = 1; for (int i = 1; i < n; i++) { fact[i] = fact[i - 1] * i % mod; } revFact[n - 1] = powMod(fact[n - 1], mod - 2); for (int i = n - 2; i >= 0; i--) { revFact[i] = revFact[i + 1] * (i + 1) % mod; } invMod[1] = 1; for (int i = 2; i < n; i++) { invMod[i] = (mod - mod / i) * invMod[mod % i] % mod; } } int64_t P(int n, int r) { return n >= r ? fact[n] * revFact[n - r] % mod : 0; } int64_t C(int n, int r) { return P(n, r) * revFact[r] % mod; } int64_t catalan(int n) { return fact[2 * n] * revFact[n] % mod * revFact[n] % mod * invMod[n + 1] % mod; } int solve_n(int n) { int ans = 0; int m = n / 2; for (int i = 0; i <= m; i++) { (ans += C(n + 2 * i, i)) %= mod; } int64_t csum = 0; for (int i = 1; i <= m; i++) { int j = m - i; (csum += catalan(i - 1)) %= mod; ans -= (C(n + 2 * j, j) * csum * 2) % mod; ans = (ans + mod) % mod; } return ans; } signed main() { int n; cin >> n; setup(n * 2 + 1); cout << solve_n(n) << endl; return 0; }