// yukicoder My Practice // author: Leonardone @ NEETSDKASU #include #include using namespace std; typedef unsigned long ul; const ul MD = 1000000007UL; // 解説読後 // http://yukicoder.me/problems/882/editorial #define arrlen(x) (sizeof(x) / sizeof((x)[0])) char str[100]; ul a[1000006]; int main() { int n; cin >> n; ul *an = a + 3, *an2 = a + 1, *an3 = a, *enda = a + size_t(n) + 5; *an2 = 1UL; while (an != enda) { *(an++) = ((*(an2++)) + (*(an3++))) % MD; } cout << a[n + 4] << endl; return 0; }