#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; const int mod = 1e9+7; int dp[1000010][3]; int main(){ int n; cin >> n; dp[0][0] = 1; dp[0][1] = 1; dp[0][2] = 1; rep(i,n) { rep(j,3) { if (j == 0) { if (i+2<=n) (dp[i+2][1] += dp[i][j]) %= mod; if (i+3<=n) (dp[i+3][2] += dp[i][j]) %= mod; } if (j == 1) { if (i+1<=n) (dp[i+1][0] += dp[i][j]) %= mod; if (i+3<=n) (dp[i+3][2] += dp[i][j]) %= mod; } if (j == 2) { if (i+1<=n) (dp[i+1][0] += dp[i][j]) %= mod; if (i+2<=n) (dp[i+2][1] += dp[i][j]) %= mod; } } } cout << (dp[n][0] + dp[n][1] + dp[n][2]) % mod / 2 << endl; return 0; }