#include #include using ll = long long; constexpr ll MOD = 1000000007; template std::vector Vec(const std::size_t n, T v) { return std::vector(n, v); } template auto Vec(const std::size_t n, Args... args) { return std::vector(n, Vec(args...)); } int main() { int N; std::cin >> N; auto dp = Vec(2, N + 1, N + 1, 0LL); // 現在の坂成分で下がったか;Aiまで決定;Ai = h; auto sum = Vec(2, N + 1, N + 1, 0LL); dp[0][0][0] = 1LL; std::fill(sum[0][0].begin(), sum[0][0].end(), 1LL); for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { (dp[0][i][j] += sum[0][i - 1][j] + sum[1][i - 1][j - 1]) %= MOD; (dp[1][i][j] += dp[1][i - 1][j] + (j == N ? 0LL : dp[1][i - 1][j + 1])) %= MOD; if (j < N and i + j >= N) { (dp[1][i][j] += dp[0][i + j - N][j + 1]) %= MOD; } sum[0][i][j] = (sum[0][i][j - 1] + dp[0][i][j]) % MOD; sum[1][i][j] = (sum[1][i][j - 1] + dp[1][i][j]) % MOD; } } std::cout << (sum[0][N][N] + sum[1][N][N]) % MOD << std::endl; return 0; }