#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define LONG_INF 100000000000000 long long dp[2000000][4] = {}; int main() { long long n; cin >> n; dp[0][0] = 1; for (int i = 1;i <= n;++i) { for (int q = 0;q < 2;++q) { dp[i][q + 1] += dp[i - 1][q]; dp[i][q + 1] %= MAX_MOD; } long long pow = 0; for (int q = 1;q <= 2;++q) { pow += dp[i - 1][q]; } dp[i][0] += pow; dp[i][0] %= MAX_MOD; } long long ans = 0; for (int i = 0;i < 4;++i) { ans += dp[n][i]; } cout << ans%MAX_MOD << endl; return 0; }