#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll mod=1000000007; ll inf=30000000000000000;//10^17 int main(){ ll n; cin >> n; vector>dp(n,vector(5,0)); dp[0][0]=1; dp[0][1]=1; for (ll i = 1; i < n; i++) { dp[i][0]+=dp[i-1][0]; dp[i][0]+=dp[i-1][2]; dp[i][1]+=dp[i-1][0]; dp[i][1]+=dp[i-1][1]; dp[i][1]+=dp[i-1][3]; dp[i][2]+=dp[i-1][1]; dp[i][3]+=dp[i-1][2]; dp[i][4]+=dp[i-1][3]; dp[i][4]+=dp[i-1][4]*2; for (ll j = 0; j <=4; j++) { dp[i][j]%=mod; } } cout << dp[n-1][4] << endl; }