#include template class ModInt{ public: uint64_t val; constexpr ModInt(): val(0){} constexpr ModInt(std::int64_t n){ if(n >= M) val = n % M; else if(n < 0) val = n % M + M; else val = n; } inline constexpr auto operator+(const ModInt &a) const {return ModInt(val + a.val);} inline constexpr auto operator-(const ModInt &a) const {return ModInt(val - a.val);} inline constexpr auto operator*(const ModInt &a) const {return ModInt(val * a.val);} inline constexpr auto operator/(const ModInt &a) const {return ModInt(val * a.inv().val);} inline constexpr auto& operator=(const ModInt &a){val = a.val; return *this;} inline constexpr auto& operator+=(const ModInt &a){if((val += a.val) >= M) val -= M; return *this;} inline constexpr auto& operator-=(const ModInt &a){if(val < a.val) val += M; val -= a.val; return *this;} inline constexpr auto& operator*=(const ModInt &a){(val *= a.val) %= M; return *this;} inline constexpr auto& operator/=(const ModInt &a){(val *= a.inv().val) %= M; return *this;} inline constexpr bool operator==(const ModInt &a) const {return val == a.val;} inline constexpr bool operator!=(const ModInt &a) const {return val != a.val;} inline constexpr auto& operator++(){*this += 1; return *this;} inline constexpr auto& operator--(){*this -= 1; return *this;} inline constexpr auto operator++(int){auto t = *this; *this += 1; return t;} inline constexpr auto operator--(int){auto t = *this; *this -= 1; return t;} inline constexpr static ModInt power(int64_t n, int64_t p){ if(p < 0) return power(n, -p).inv(); int64_t ret = 1, e = n; for(; p; (e *= e) %= M, p >>= 1) if(p & 1) (ret *= e) %= M; return ret; } inline constexpr static ModInt inv(int64_t a){ int64_t b = M, u = 1, v = 0; while(b){ int64_t t = a / b; a -= t * b; std::swap(a,b); u -= t * v; std::swap(u,v); } u %= M; if(u < 0) u += M; return u; } inline constexpr static auto frac(int64_t a, int64_t b){return ModInt(a) / ModInt(b);} inline constexpr auto power(int64_t p) const {return power(val, p);} inline constexpr auto inv() const {return inv(val);} friend inline constexpr auto operator-(const ModInt &a){return ModInt(-a.val);} friend inline constexpr auto operator+(int64_t a, const ModInt &b){return ModInt(a) + b;} friend inline constexpr auto operator-(int64_t a, const ModInt &b){return ModInt(a) - b;} friend inline constexpr auto operator*(int64_t a, const ModInt &b){return ModInt(a) * b;} friend inline constexpr auto operator/(int64_t a, const ModInt &b){return ModInt(a) / b;} friend std::istream& operator>>(std::istream &s, ModInt &a){s >> a.val; return s;} friend std::ostream& operator<<(std::ostream &s, const ModInt &a){s << a.val; return s;} template inline static auto div(){ static auto value = inv(N); return value; } }; /** * @attention 使用前にinit関数を呼び出す */ template class Combinatorics{ public: static std::vector facto; static std::vector ifacto; static void init(int N){ facto.assign(N+1, 1); ifacto.assign(N+1, 1); for(int i = 1; i <= N; ++i){ facto[i] = facto[i-1] * i; } ifacto[N] = facto[N].inv(); for(int i = N-1; i >= 0; --i){ ifacto[i] = ifacto[i+1] * (i+1); } } static T f(int64_t i){ assert(i < facto.size()); return facto[i]; } static T finv(int64_t i){ assert(i < ifacto.size()); return ifacto[i]; } static T P(int64_t n, int64_t k); static T C(int64_t n, int64_t k); static T H(int64_t n, int64_t k); static T stirling_number(int64_t n, int64_t k); static T bell_number(int64_t n, int64_t k); static std::vector bernoulli_number(int64_t n); static T catalan_number(int64_t n); }; template std::vector Combinatorics::facto = std::vector(); template std::vector Combinatorics::ifacto = std::vector(); template T Combinatorics::P(int64_t n, int64_t k){ if(n < k or n < 0 or k < 0) return 0; return f(n) * finv(n-k); } template T Combinatorics::C(int64_t n, int64_t k){ if(n < k or n < 0 or k < 0) return 0; return P(n,k) * finv(k); } template T Combinatorics::H(int64_t n, int64_t k){ if(n == 0 and k == 0) return 1; return C(n+k-1, k); } /** * @brief c_0 = 1, c_{n+1} = ∑_{i=0}^n c_i * c_{n-i} を満たす数列の第n項。 * @note 長さ2nの対応の取れた括弧列の総数はc_n通り。 */ template T Combinatorics::catalan_number(int64_t n){ return C(2*n,n) - C(2*n,n-1); } using mint = ModInt<1000000007>; using C = Combinatorics; int main(){ C::init(500000); int N; std::cin >> N; std::vector c(N+1); for(int i = 0; i <= N; ++i){ c[i] = C::catalan_number(i); } for(int i = 1; i <= N; ++i){ c[i] += c[i-1]; } mint ans = 0; for(int k = 0; k <= N / 2; ++k){ ans += C::C(N+2*k, k); } for(int k = 0; k < N / 2; ++k){ ans -= C::C(N+2*k, k) * c[N/2-k-1] * 2; } std::cout << ans << std::endl; return 0; }