#include<iostream> #define M 1000000007 #define MAX_N 1000000 using namespace std; typedef long long ll; ll fact_n[MAX_N + 1], fact_inv[MAX_N + 1]; ll mod_pow(ll a, ll n) { ll x = 1; while (n > 0) { if (n & 1) x = x * a % M; a = a * a % M; n >>= 1; } return x; } ll combination(int n, int r) { if (n == 0 && r == 0) return 1; else if (n < r || n < 0) return 0; ll com = fact_n[n] * fact_inv[r] % M; return com * fact_inv[n - r] % M; } int main() { int n, j; ll com = 0; cin >> n; fact_n[0] = fact_inv[0] = 1; for (int i = 1;i <= MAX_N;i++) fact_n[i] = fact_n[i - 1] * i % M; fact_inv[MAX_N] = mod_pow(fact_n[MAX_N], M - 2); for (int i = MAX_N - 1;i > 0;i--) fact_inv[i] = fact_inv[i + 1] * (i + 1) % M; for (int i = 0;i <= n;i++) { if (n - 2 * i >= 0) { j = (n - 2 * i) / 3; com += combination(i + j, i) % M; } } cout << com % M << endl; return 0; }