#include using namespace std; using LL = long long; using ULL = unsigned long long; constexpr int MOD = 1'000'000'007; int dp[1000001][4]; int main() { int N; cin >> N; dp[1][1] = 1; dp[2][2] = 1; dp[3][3] = 1; for (int i = 1; i <= N; i++) { // if (i + 2 <= N) dp[i + 2][2] = (dp[i + 2][2] + dp[i][1]) % MOD; if (i + 3 <= N) dp[i + 3][3] = (dp[i + 3][3] + dp[i][1]) % MOD; // if (i + 1 <= N) dp[i + 1][1] = (dp[i + 1][1] + dp[i][2]) % MOD; if (i + 3 <= N) dp[i + 3][3] = (dp[i + 3][3] + dp[i][2]) % MOD; // if (i + 1 <= N) dp[i + 1][1] = (dp[i + 1][1] + dp[i][3]) % MOD; if (i + 2 <= N) dp[i + 2][2] = (dp[i + 2][2] + dp[i][3]) % MOD; } cout << ((dp[N][1] + dp[N][2]) % MOD + dp[N][3]) % MOD << endl; }