#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) int n; int memo[1000010][3]; int saiki(int now,int how_ken){ if(memo[now][how_ken] != INF) return memo[now][how_ken]; if(how_ken == 3) return 0; if(now == n) return 1; int a = 0,b = 0; if(how_ken <= 1) a = saiki(now + 1,how_ken + 1); //ken if(how_ken != 0) b = saiki(now + 1,0); //pa return memo[now][how_ken] = (a + b) % 1000000007; } int main() { for(int i = 0;i < 1000010;i++){ for(int j = 0;j < 3;j++){ memo[i][j] = INF; } } cin >> n; cout << saiki(0,0) % 1000000007 << endl; return 0; }